A significant number of hotel bookings are called-off due to cancellations or no-shows. The typical reasons for cancellations include change of plans, scheduling conflicts, etc. This is often made easier by the option to do so free of charge or preferably at a low cost which is beneficial to hotel guests but it is a less desirable and possibly revenue-diminishing factor for hotels to deal with. Such losses are particularly high on last-minute cancellations.
The new technologies involving online booking channels have dramatically changed customers’ booking possibilities and behavior. This adds a further dimension to the challenge of how hotels handle cancellations, which are no longer limited to traditional booking and guest characteristics.
Loss of resources (revenue) when the hotel cannot resell the room. Additional costs of distribution channels by increasing commissions or paying for publicity to help sell these rooms. Lowering prices last minute, so the hotel can resell a room, resulting in reducing the profit margin. Human resources to make arrangements for the guests. Objective The increasing number of cancellations calls for a Machine Learning based solution that can help in predicting which booking is likely to be canceled. Star Hotels Group has a chain of hotels in Portugal, they are facing problems with the high number of booking cancellations and have reached out to your firm for data-driven solutions. You as a data scientist have to analyze the data provided to find which factors have a high influence on booking cancellations, build a predictive model that can predict which booking is going to be canceled in advance, and help in formulating profitable policies for cancellations and refunds.
The data contains the different attributes of customers' booking details. The detailed data dictionary is given below.
#this will help in making the Python code more structured automatically (good coding practice)
#%load_ext nb_black
import warnings
warnings.filterwarnings("ignore")
from statsmodels.tools.sm_exceptions import ConvergenceWarning
warnings.simplefilter("ignore", ConvergenceWarning)
# Libraries to help with reading and manipulating data
import pandas as pd
import numpy as np
# Library to split data
from sklearn.model_selection import train_test_split
# libaries to help with data visualization
import matplotlib.pyplot as plt
import seaborn as sns
# Removes the limit for the number of displayed columns
pd.set_option("display.max_columns", None)
# Sets the limit for the number of displayed rows
pd.set_option("display.max_rows", 200)
# Libraries to build decision tree classifier
from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
# To tune different models
from sklearn.model_selection import GridSearchCV
# To build model for prediction
import statsmodels.stats.api as sms
from statsmodels.stats.outliers_influence import variance_inflation_factor
import statsmodels.api as sm
from statsmodels.tools.tools import add_constant
from sklearn.linear_model import LogisticRegression
# To get diferent metric scores
from sklearn.metrics import (
f1_score,
accuracy_score,
recall_score,
precision_score,
confusion_matrix,
roc_auc_score,
plot_confusion_matrix,
precision_recall_curve,
roc_curve,
make_scorer
)
data = pd.read_csv('F:\Mc Comb School - Austin University\Datasets\StarHotelsGroup.csv')
df = data.copy()
np.random.seed(1)
df.sample(10)
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | type_of_meal_plan | required_car_parking_space | room_type_reserved | lead_time | arrival_year | arrival_month | arrival_date | market_segment_type | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | booking_status | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10043 | 1 | 0 | 0 | 2 | Not Selected | 0 | Room_Type 1 | 37 | 2018 | 10 | 27 | Online | 0 | 0 | 0 | 109.00 | 1 | Not_Canceled |
| 39715 | 2 | 1 | 2 | 3 | Meal Plan 1 | 0 | Room_Type 1 | 104 | 2019 | 4 | 6 | Online | 0 | 0 | 0 | 101.15 | 0 | Not_Canceled |
| 30095 | 2 | 0 | 0 | 1 | Not Selected | 0 | Room_Type 1 | 20 | 2019 | 4 | 20 | Online | 0 | 0 | 0 | 115.00 | 0 | Not_Canceled |
| 11327 | 1 | 0 | 2 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 162 | 2018 | 10 | 14 | Online | 0 | 0 | 0 | 115.00 | 0 | Canceled |
| 45593 | 1 | 0 | 2 | 6 | Meal Plan 1 | 0 | Room_Type 1 | 115 | 2018 | 2 | 27 | Offline | 0 | 0 | 0 | 64.75 | 0 | Canceled |
| 19258 | 1 | 0 | 2 | 1 | Meal Plan 1 | 0 | Room_Type 5 | 2 | 2019 | 5 | 7 | Aviation | 1 | 0 | 1 | 125.00 | 0 | Not_Canceled |
| 5654 | 2 | 0 | 1 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 0 | 2017 | 9 | 21 | Corporate | 0 | 0 | 0 | 65.00 | 0 | Not_Canceled |
| 15474 | 2 | 1 | 1 | 3 | Meal Plan 1 | 0 | Room_Type 1 | 57 | 2018 | 8 | 15 | Online | 0 | 0 | 0 | 152.10 | 0 | Not_Canceled |
| 16553 | 3 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 4 | 73 | 2018 | 9 | 6 | Online | 0 | 0 | 0 | 168.30 | 2 | Not_Canceled |
| 17911 | 2 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 4 | 6 | 2017 | 12 | 31 | Online | 0 | 0 | 0 | 137.00 | 1 | Not_Canceled |
df.shape
(56926, 18)
Observations
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 56926 entries, 0 to 56925 Data columns (total 18 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 no_of_adults 56926 non-null int64 1 no_of_children 56926 non-null int64 2 no_of_weekend_nights 56926 non-null int64 3 no_of_week_nights 56926 non-null int64 4 type_of_meal_plan 56926 non-null object 5 required_car_parking_space 56926 non-null int64 6 room_type_reserved 56926 non-null object 7 lead_time 56926 non-null int64 8 arrival_year 56926 non-null int64 9 arrival_month 56926 non-null int64 10 arrival_date 56926 non-null int64 11 market_segment_type 56926 non-null object 12 repeated_guest 56926 non-null int64 13 no_of_previous_cancellations 56926 non-null int64 14 no_of_previous_bookings_not_canceled 56926 non-null int64 15 avg_price_per_room 56926 non-null float64 16 no_of_special_requests 56926 non-null int64 17 booking_status 56926 non-null object dtypes: float64(1), int64(13), object(4) memory usage: 7.8+ MB
Observations
df.isnull().sum()
no_of_adults 0 no_of_children 0 no_of_weekend_nights 0 no_of_week_nights 0 type_of_meal_plan 0 required_car_parking_space 0 room_type_reserved 0 lead_time 0 arrival_year 0 arrival_month 0 arrival_date 0 market_segment_type 0 repeated_guest 0 no_of_previous_cancellations 0 no_of_previous_bookings_not_canceled 0 avg_price_per_room 0 no_of_special_requests 0 booking_status 0 dtype: int64
observations
# fixing the names of columns as there are dots, spaces in columns names
data.columns = [col.replace(" ", "_") for col in data.columns]
data.columns = [col.replace("-", "_") for col in data.columns]
data.columns = [col.replace(".", "") for col in data.columns]
data.columns
Index(['no_of_adults', 'no_of_children', 'no_of_weekend_nights',
'no_of_week_nights', 'type_of_meal_plan', 'required_car_parking_space',
'room_type_reserved', 'lead_time', 'arrival_year', 'arrival_month',
'arrival_date', 'market_segment_type', 'repeated_guest',
'no_of_previous_cancellations', 'no_of_previous_bookings_not_canceled',
'avg_price_per_room', 'no_of_special_requests', 'booking_status'],
dtype='object')
numeric_col = df.select_dtypes(include=np.number).columns.to_list()
df_describe = df.describe().T
df_describe['median']= [df[col].median() for col in numeric_col]
df_describe['sum']=[df[col].sum() for col in numeric_col]
df_describe.head(10)
| count | mean | std | min | 25% | 50% | 75% | max | median | sum | |
|---|---|---|---|---|---|---|---|---|---|---|
| no_of_adults | 56926.0 | 1.875856 | 0.518667 | 0.0 | 2.0 | 2.0 | 2.0 | 4.0 | 2.0 | 106785.0 |
| no_of_children | 56926.0 | 0.110723 | 0.408885 | 0.0 | 0.0 | 0.0 | 0.0 | 10.0 | 0.0 | 6303.0 |
| no_of_weekend_nights | 56926.0 | 0.835840 | 0.875900 | 0.0 | 0.0 | 1.0 | 2.0 | 8.0 | 1.0 | 47581.0 |
| no_of_week_nights | 56926.0 | 2.261901 | 1.432371 | 0.0 | 1.0 | 2.0 | 3.0 | 17.0 | 2.0 | 128761.0 |
| required_car_parking_space | 56926.0 | 0.026332 | 0.160123 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1499.0 |
| lead_time | 56926.0 | 93.713909 | 92.408296 | 0.0 | 21.0 | 65.0 | 142.0 | 521.0 | 65.0 | 5334758.0 |
| arrival_year | 56926.0 | 2018.248340 | 0.644619 | 2017.0 | 2018.0 | 2018.0 | 2019.0 | 2019.0 | 2018.0 | 114890805.0 |
| arrival_month | 56926.0 | 6.490215 | 3.027185 | 1.0 | 4.0 | 6.0 | 9.0 | 12.0 | 6.0 | 369462.0 |
| arrival_date | 56926.0 | 15.635913 | 8.718717 | 1.0 | 8.0 | 16.0 | 23.0 | 31.0 | 16.0 | 890090.0 |
| repeated_guest | 56926.0 | 0.024664 | 0.155099 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 1404.0 |
Observations
repeated guest teach us that very few guest come back.
Star Hotel are mainly business hotels, few people come back. These hotels are placed easily accessible either by cab or public transportations. The length of lead time indicate that maybe these hotels are close to airports s business flight dominate tourism ones.
cat_cols = df.describe(include='object').columns.to_list()
cat_cols
['type_of_meal_plan', 'room_type_reserved', 'market_segment_type', 'booking_status']
for i in cat_cols:
print("Unique values in", i, "are :")
print(df[i].value_counts())
print("*" * 50)
Unique values in type_of_meal_plan are : Meal Plan 1 42330 Not Selected 10072 Meal Plan 2 4516 Meal Plan 3 8 Name: type_of_meal_plan, dtype: int64 ************************************************** Unique values in room_type_reserved are : Room_Type 1 42807 Room_Type 4 10413 Room_Type 6 1581 Room_Type 5 983 Room_Type 2 823 Room_Type 7 312 Room_Type 3 7 Name: room_type_reserved, dtype: int64 ************************************************** Unique values in market_segment_type are : Online 39490 Offline 13875 Corporate 2796 Complementary 536 Aviation 229 Name: market_segment_type, dtype: int64 ************************************************** Unique values in booking_status are : Not_Canceled 35378 Canceled 21548 Name: booking_status, dtype: int64 **************************************************
Observations
def histogram_boxplot(data, feature, figsize=(12, 7), kde=False, bins=None):
"""
Boxplot and histogram combined
data: dataframe
feature: dataframe column
figsize: size of figure (default (12,7))
kde: whether to show the density curve (default False)
bins: number of bins for histogram (default None)
"""
f2, (ax_box2, ax_hist2) = plt.subplots(
nrows=2, # Number of rows of the subplot grid= 2
sharex=True, # x-axis will be shared among all subplots
gridspec_kw={"height_ratios": (0.25, 0.75)},
figsize=figsize,
) # creating the 2 subplots
sns.boxplot(
data=data, x=feature, ax=ax_box2, showmeans=True, color="violet"
) # boxplot will be created and a star will indicate the mean value of the column
sns.histplot(
data=data, x=feature, kde=kde, ax=ax_hist2, bins=bins, palette="winter"
) if bins else sns.histplot(
data=data, x=feature, kde=kde, ax=ax_hist2
) # For histogram
ax_hist2.axvline(
data[feature].mean(), color="green", linestyle="--"
) # Add mean to the histogram
ax_hist2.axvline(
data[feature].median(), color="black", linestyle="-"
) # Add median to the histogram
for i,col in enumerate(numeric_col):
histogram_boxplot(df, col)
Observations
# function to create labeled barplots
def labeled_barplot(data, feature, perc=False, n=None):
"""
Barplot with percentage at the top
data: dataframe
feature: dataframe column
perc: whether to display percentages instead of count (default is False)
n: displays the top n category levels (default is None, i.e., display all levels)
"""
total = len(data[feature]) # length of the column
count = data[feature].nunique()
if n is None:
plt.figure(figsize=(count + 1, 5))
else:
plt.figure(figsize=(n + 1, 5))
plt.xticks(rotation=90, fontsize=15)
ax = sns.countplot(
data=data,
x=feature,
palette="Paired",
order=data[feature].value_counts().index[:n].sort_values(),
)
for p in ax.patches:
if perc == True:
label = "{:.1f}%".format(
100 * p.get_height() / total
) # percentage of each class of the category
else:
label = p.get_height() # count of each level of the category
x = p.get_x() + p.get_width() / 2 # width of the plot
y = p.get_height() # height of the plot
ax.annotate(
label,
(x, y),
ha="center",
va="center",
size=12,
xytext=(0, 5),
textcoords="offset points",
) # annotate the percentage
plt.show() # show the plot
for col in cat_cols:
labeled_barplot(df, col, perc=True)
Observations
Nothing more than what has been already said
corr = df.corr()
plt.figure(figsize=(20,20))
sns.heatmap(corr, annot=True, vmin=-1, vmax=1, fmt=".2f", cmap="Spectral")
<AxesSubplot:>
sns.pairplot(df, diag_kind='kde', corner=True)
<seaborn.axisgrid.PairGrid at 0x25ba63fdb20>
Observations
There are no correlations between the numeric variables
### Function to plot stacked bar charts for categorical columns
def stacked_plot(x):
sns.set()
## crosstab
tab1 = pd.crosstab(x, data["salary"], margins=True).sort_values(
by=" >50K", ascending=False
)
print(tab1)
print("-" * 120)
## visualising the cross tab
tab = pd.crosstab(x, data["salary"], normalize="index").sort_values(
by=" >50K", ascending=False
)
tab.plot(kind="bar", stacked=True, figsize=(17, 7))
plt.legend(
loc="lower left", frameon=False,
)
plt.legend(loc="upper left", bbox_to_anchor=(1, 1))
plt.show()
def stacked_barplot(data, predictor, target):
"""
Print the category counts and plot a stacked bar chart
data: dataframe
predictor: independent variable
target: target variable
"""
count = data[predictor].nunique()
sorter = data[target].value_counts().index[-1]
tab1 = pd.crosstab(data[predictor], data[target], margins=True).sort_values(
by=sorter, ascending=False
)
print(tab1)
print("-" * 120)
tab = pd.crosstab(data[predictor], data[target], normalize="index").sort_values(
by=sorter, ascending=False
)
tab.plot(kind="bar", stacked=True, figsize=(count + 5, 5))
plt.legend(
loc="lower left", frameon=False,
)
plt.legend(loc="upper left", bbox_to_anchor=(1, 1))
plt.show()
for col in cat_cols:
stacked_barplot(df, col, 'booking_status')
booking_status Canceled Not_Canceled All type_of_meal_plan All 21548 35378 56926 Meal Plan 1 15547 26783 42330 Not Selected 3793 6279 10072 Meal Plan 2 2207 2309 4516 Meal Plan 3 1 7 8 ------------------------------------------------------------------------------------------------------------------------
booking_status Canceled Not_Canceled All room_type_reserved All 21548 35378 56926 Room_Type 1 15651 27156 42807 Room_Type 4 4206 6207 10413 Room_Type 6 856 725 1581 Room_Type 5 408 575 983 Room_Type 2 311 512 823 Room_Type 7 114 198 312 Room_Type 3 2 5 7 ------------------------------------------------------------------------------------------------------------------------
booking_status Canceled Not_Canceled All market_segment_type All 21548 35378 56926 Online 16524 22966 39490 Offline 4538 9337 13875 Corporate 437 2359 2796 Aviation 49 180 229 Complementary 0 536 536 ------------------------------------------------------------------------------------------------------------------------
booking_status Canceled Not_Canceled All booking_status Canceled 21548 0 21548 All 21548 35378 56926 Not_Canceled 0 35378 35378 ------------------------------------------------------------------------------------------------------------------------
Observations
### function to plot distributions wrt target
def distribution_plot_wrt_target(data, predictor, target):
fig, axs = plt.subplots(2, 2, figsize=(12, 10))
target_uniq = data[target].unique()
axs[0, 0].set_title("Distribution of target for target=" + str(target_uniq[0]))
sns.histplot(
data=data[data[target] == target_uniq[0]],
x=predictor,
kde=True,
ax=axs[0, 0],
color="teal",
stat="density",
)
axs[0, 1].set_title("Distribution of target for target=" + str(target_uniq[1]))
sns.histplot(
data=data[data[target] == target_uniq[1]],
x=predictor,
kde=True,
ax=axs[0, 1],
color="orange",
stat="density",
)
axs[1, 0].set_title("Boxplot w.r.t target")
sns.boxplot(data=data, x=target, y=predictor, ax=axs[1, 0], palette="gist_rainbow")
axs[1, 1].set_title("Boxplot (without outliers) w.r.t target")
sns.boxplot(
data=data,
x=target,
y=predictor,
ax=axs[1, 1],
showfliers=False,
palette="gist_rainbow",
)
plt.tight_layout()
plt.show()
numeric_col = df.select_dtypes(include=np.number).columns.to_list()
numeric_col
['no_of_adults', 'no_of_children', 'no_of_weekend_nights', 'no_of_week_nights', 'required_car_parking_space', 'lead_time', 'arrival_year', 'arrival_month', 'arrival_date', 'repeated_guest', 'no_of_previous_cancellations', 'no_of_previous_bookings_not_canceled', 'avg_price_per_room', 'no_of_special_requests']
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 56926 entries, 0 to 56925 Data columns (total 18 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 no_of_adults 56926 non-null int64 1 no_of_children 56926 non-null int64 2 no_of_weekend_nights 56926 non-null int64 3 no_of_week_nights 56926 non-null int64 4 type_of_meal_plan 56926 non-null object 5 required_car_parking_space 56926 non-null int64 6 room_type_reserved 56926 non-null object 7 lead_time 56926 non-null int64 8 arrival_year 56926 non-null int64 9 arrival_month 56926 non-null int64 10 arrival_date 56926 non-null int64 11 market_segment_type 56926 non-null object 12 repeated_guest 56926 non-null int64 13 no_of_previous_cancellations 56926 non-null int64 14 no_of_previous_bookings_not_canceled 56926 non-null int64 15 avg_price_per_room 56926 non-null float64 16 no_of_special_requests 56926 non-null int64 17 booking_status 56926 non-null object dtypes: float64(1), int64(13), object(4) memory usage: 7.8+ MB
list_to_supress = ['no_of_adults', 'no_of_children', 'repeated_guest', 'no_of_previous_cancellations','no_of_previous_bookings_not_canceled', 'required_car_parking_space']
numeric_col
['no_of_adults', 'no_of_children', 'no_of_weekend_nights', 'no_of_week_nights', 'required_car_parking_space', 'lead_time', 'arrival_year', 'arrival_month', 'arrival_date', 'repeated_guest', 'no_of_previous_cancellations', 'no_of_previous_bookings_not_canceled', 'avg_price_per_room', 'no_of_special_requests']
a = set(numeric_col)
b= set(list_to_supress)
new_list = a.difference(b)
new_list
{'arrival_date',
'arrival_month',
'arrival_year',
'avg_price_per_room',
'lead_time',
'no_of_special_requests',
'no_of_week_nights',
'no_of_weekend_nights'}
for col in new_list:
distribution_plot_wrt_target(df, col, 'booking_status')
we replace canceled and not canceled by 1 and 0, respectively, as we are focusing on Cancellation motivations
df['booking_status']=df['booking_status'].replace(to_replace='Not_Canceled', value='0')
df['booking_status']=df['booking_status'].replace(to_replace='Canceled', value='1')
df.head()
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | type_of_meal_plan | required_car_parking_space | room_type_reserved | lead_time | arrival_year | arrival_month | arrival_date | market_segment_type | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | booking_status | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 224 | 2017 | 10 | 2 | Offline | 0 | 0 | 0 | 65.00 | 0 | 0 |
| 1 | 2 | 0 | 2 | 3 | Not Selected | 0 | Room_Type 1 | 5 | 2018 | 11 | 6 | Online | 0 | 0 | 0 | 106.68 | 1 | 0 |
| 2 | 1 | 0 | 2 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 1 | 2018 | 2 | 28 | Online | 0 | 0 | 0 | 60.00 | 0 | 1 |
| 3 | 2 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 211 | 2018 | 5 | 20 | Online | 0 | 0 | 0 | 100.00 | 0 | 1 |
| 4 | 3 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 277 | 2019 | 7 | 13 | Online | 0 | 0 | 0 | 89.10 | 2 | 1 |
df['booking_status']=df['booking_status'].astype('float')
df_canceled = df.query('booking_status==1')
df_canceled.head()
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | type_of_meal_plan | required_car_parking_space | room_type_reserved | lead_time | arrival_year | arrival_month | arrival_date | market_segment_type | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | booking_status | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 1 | 0 | 2 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 1 | 2018 | 2 | 28 | Online | 0 | 0 | 0 | 60.0 | 0 | 1.0 |
| 3 | 2 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 211 | 2018 | 5 | 20 | Online | 0 | 0 | 0 | 100.0 | 0 | 1.0 |
| 4 | 3 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 277 | 2019 | 7 | 13 | Online | 0 | 0 | 0 | 89.1 | 2 | 1.0 |
| 5 | 2 | 0 | 1 | 1 | Not Selected | 0 | Room_Type 1 | 48 | 2018 | 4 | 11 | Online | 0 | 0 | 0 | 94.5 | 0 | 1.0 |
| 7 | 2 | 0 | 0 | 2 | Meal Plan 2 | 0 | Room_Type 1 | 346 | 2018 | 9 | 13 | Online | 0 | 0 | 0 | 115.0 | 1 | 1.0 |
df_canceled.filter(items=['no_of_adults', 'no_of_children', 'no_of_weekend_nights', 'no_of_week_nights']).sum()/df.filter(items=['no_of_adults', 'no_of_children', 'no_of_weekend_nights', 'no_of_week_nights']).sum()
no_of_adults 0.392499 no_of_children 0.474060 no_of_weekend_nights 0.407432 no_of_week_nights 0.408781 dtype: float64
Observations
Here we try to detect if the number of adult, children, week-end or week night could be a differentiate factor for the 'Cancelers'
df.filter(items=['no_of_adults', 'no_of_children', 'no_of_weekend_nights', 'no_of_week_nights']).sum()
no_of_adults 106785 no_of_children 6303 no_of_weekend_nights 47581 no_of_week_nights 128761 dtype: int64
df_canceled.filter(items=['type_of_meal_plan', 'room_type_reserved','arrival_year','arrival_month','arrival_date', 'market_segment_type', 'no_of_previous_cancellations', 'no_of_previous_bookings_not_canceled']).mode()
| type_of_meal_plan | room_type_reserved | arrival_year | arrival_month | arrival_date | market_segment_type | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | |
|---|---|---|---|---|---|---|---|---|
| 0 | Meal Plan 1 | Room_Type 1 | 2018 | 7 | 15 | Online | 0 | 0 |
We try to determine a generic profile of cancelers with the mode function
Cancelers prefers Meal Plan 1, Room Type 1, market segment type Online and is a newcomer (no cancellation history or previous booking not canceled). They often reserve un July and mostly in 2018.
df_canceled['market_segment_type'].value_counts(normalize=True)
Online 0.766846 Offline 0.210600 Corporate 0.020280 Aviation 0.002274 Name: market_segment_type, dtype: float64
Observations
df_canceled['room_type_reserved'].value_counts(normalize=True)
Room_Type 1 0.726332 Room_Type 4 0.195192 Room_Type 6 0.039725 Room_Type 5 0.018934 Room_Type 2 0.014433 Room_Type 7 0.005291 Room_Type 3 0.000093 Name: room_type_reserved, dtype: float64
Observations
df_canceled['arrival_year'].value_counts(normalize=True)
2018 0.506961 2019 0.448441 2017 0.044598 Name: arrival_year, dtype: float64
df_canceled['no_of_previous_cancellations'].value_counts(normalize=True)
0 0.999165 1 0.000603 13 0.000186 3 0.000046 Name: no_of_previous_cancellations, dtype: float64
df_canceled['no_of_previous_bookings_not_canceled'].value_counts(normalize=True)
0 0.999582 1 0.000186 10 0.000093 12 0.000046 6 0.000046 4 0.000046 Name: no_of_previous_bookings_not_canceled, dtype: float64
# user-defined function to compare the equality of two means from two independent populations, where population standard deviations are known
# this function returns the p-value for one tailed test
# for two-tailed test, multiply the p-value by 2
# To know more about the derivation of test statistic and standard error formula, please refer to the monographs and additional materials
def ztest_2samp(X1, X2, pop_sd1, pop_sd2, n1, n2):
'''
X1 - first of the two independent samples (sample 1)
X2 - second of the two independent samples (sample 2)
pop_sd1 - population standard deviation of sample 1
pop_sd2 - population standard deviation of sample 2
n1 - size of sample 1
n2 - size of sample 2
'''
from numpy import sqrt, abs # import the required functions
from scipy.stats import norm # import the required function
se = sqrt(pop_sd1**2/n1 + pop_sd2**2/n2) # calculate the standard error
test_stat = ((X1.mean() - X2.mean()) - 0)/ se # calculate the test statistic
pval = 1 - norm.cdf(abs(test_stat)) # calculate the one-tailed p-value
return print('the pvalue is :', pval, 'the test_stat is :', round(test_stat, 4)) # return the p-value and test stat value
lead_time_mean_canc = df_canceled['lead_time'].mean()
print('the average lead time value for canceled is : {}'.format(lead_time_mean_canc))
the average lead time value for canceled is : 147.67249860775942
df_not_canceled = df.query('booking_status==0')
lead_time_mean_not_canc = df_not_canceled['lead_time'].mean()
print('the average lead time value for not canceled is : {}'.format(lead_time_mean_not_canc))
the average lead time value for not canceled is : 60.84886087398949
Null and alternative hypothesis
Let 𝜇 be the mean lead time
𝜇1 : mean lead time for canceled
𝜇2 : mean lead time for not canceled
The nul hypothesis is equality of means, in other words there is no difference in lead time between canceled and not canceled 𝜇1 = 𝜇2
The alternate Hypothesis is the lead time is higher for canceled than not canceled 𝜇1 > 𝜇2
p_value is below the 0.05 cut so we can reject the null. The alternative hypothesis is validated. The mean lead time for canceled is higher (143 days) than the mean lead time for not canceled (60 days).
avg_price_mean_canc = df_canceled['avg_price_per_room'].mean()
print('the average price per room value for canceled is : {}'.format(avg_price_mean_canc))
the average price per room value for canceled is : 118.47455726749601
avg_price_mean_not_canc = df_not_canceled['avg_price_per_room'].mean()
print('the average lead time value for not canceled is : {}'.format(avg_price_mean_not_canc))
the average lead time value for not canceled is : 104.21170133981447
Null and alternative hypothesis
Let 𝜇 be the mean average price
𝜇1 : mean average price for canceled
𝜇2 : mean average price for not canceled
The nul hypothesis is equality of means, in other words there is no difference in average price between canceled and not canceled 𝜇1 = 𝜇2
The alternate Hypothesis is the avegrage price per room is higher for the canceled than the not canceled 𝜇1 > 𝜇2
#performing a ztest on the 2 sample to determine the p_value
ztest_2samp(df_canceled['avg_price_per_room'], df_not_canceled['avg_price_per_room'], df_canceled['avg_price_per_room'].std(), df_not_canceled['avg_price_per_room'].std(), df_canceled['avg_price_per_room'].count(), df_not_canceled['avg_price_per_room'].count())
the pvalue is : 0.0 the test_stat is : 44.1552
p value is below the 0.05 cut ratio. Thus the null hypothesis is rejected. The alternative hypothesis is validated. There is a difference between the average price per room between canceled (117) and not_canceled (104)
Observations
Conclusions
Observations
As a conclusion, canceled seems concern more hollydays vacations and so families.
Outliers Treatments
# functions to treat outliers by flooring and capping
def treat_outliers(df, col):
"""
Treats outliers in a variable
df: dataframe
col: dataframe column
"""
Q1 = df[col].quantile(0.25) # 25th quantile
Q3 = df[col].quantile(0.75) # 75th quantile
IQR = Q3 - Q1
Lower_Whisker = Q1 - 1.5 * IQR
Upper_Whisker = Q3 + 1.5 * IQR
# all the values smaller than Lower_Whisker will be assigned the value of Lower_Whisker
# all the values greater than Upper_Whisker will be assigned the value of Upper_Whisker
df[col] = np.clip(df[col], Lower_Whisker, Upper_Whisker)
return df
def treat_outliers_all(df, col_list):
"""
Treat outliers in a list of variables
df: dataframe
col_list: list of dataframe columns
"""
for c in col_list:
df = treat_outliers(df, c)
return df
treat_outliers(df, 'avg_price_per_room')
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | type_of_meal_plan | required_car_parking_space | room_type_reserved | lead_time | arrival_year | arrival_month | arrival_date | market_segment_type | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | booking_status | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 224 | 2017 | 10 | 2 | Offline | 0 | 0 | 0 | 65.00 | 0 | 0.0 |
| 1 | 2 | 0 | 2 | 3 | Not Selected | 0 | Room_Type 1 | 5 | 2018 | 11 | 6 | Online | 0 | 0 | 0 | 106.68 | 1 | 0.0 |
| 2 | 1 | 0 | 2 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 1 | 2018 | 2 | 28 | Online | 0 | 0 | 0 | 60.00 | 0 | 1.0 |
| 3 | 2 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 211 | 2018 | 5 | 20 | Online | 0 | 0 | 0 | 100.00 | 0 | 1.0 |
| 4 | 3 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 277 | 2019 | 7 | 13 | Online | 0 | 0 | 0 | 89.10 | 2 | 1.0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 56921 | 2 | 1 | 0 | 1 | Meal Plan 2 | 0 | Room_Type 4 | 45 | 2019 | 6 | 15 | Online | 0 | 0 | 0 | 163.88 | 1 | 0.0 |
| 56922 | 2 | 0 | 1 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 320 | 2019 | 5 | 15 | Offline | 0 | 0 | 0 | 90.00 | 1 | 1.0 |
| 56923 | 2 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 63 | 2018 | 4 | 21 | Online | 0 | 0 | 0 | 94.50 | 0 | 1.0 |
| 56924 | 2 | 0 | 2 | 2 | Not Selected | 0 | Room_Type 1 | 6 | 2019 | 4 | 28 | Online | 0 | 0 | 0 | 162.50 | 2 | 0.0 |
| 56925 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 207 | 2018 | 12 | 30 | Offline | 0 | 0 | 0 | 161.67 | 0 | 0.0 |
56926 rows × 18 columns
treat_outliers(df,'lead_time')
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | type_of_meal_plan | required_car_parking_space | room_type_reserved | lead_time | arrival_year | arrival_month | arrival_date | market_segment_type | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | booking_status | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 224.0 | 2017 | 10 | 2 | Offline | 0 | 0 | 0 | 65.00 | 0 | 0.0 |
| 1 | 2 | 0 | 2 | 3 | Not Selected | 0 | Room_Type 1 | 5.0 | 2018 | 11 | 6 | Online | 0 | 0 | 0 | 106.68 | 1 | 0.0 |
| 2 | 1 | 0 | 2 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 1.0 | 2018 | 2 | 28 | Online | 0 | 0 | 0 | 60.00 | 0 | 1.0 |
| 3 | 2 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 211.0 | 2018 | 5 | 20 | Online | 0 | 0 | 0 | 100.00 | 0 | 1.0 |
| 4 | 3 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 277.0 | 2019 | 7 | 13 | Online | 0 | 0 | 0 | 89.10 | 2 | 1.0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 56921 | 2 | 1 | 0 | 1 | Meal Plan 2 | 0 | Room_Type 4 | 45.0 | 2019 | 6 | 15 | Online | 0 | 0 | 0 | 163.88 | 1 | 0.0 |
| 56922 | 2 | 0 | 1 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 320.0 | 2019 | 5 | 15 | Offline | 0 | 0 | 0 | 90.00 | 1 | 1.0 |
| 56923 | 2 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 63.0 | 2018 | 4 | 21 | Online | 0 | 0 | 0 | 94.50 | 0 | 1.0 |
| 56924 | 2 | 0 | 2 | 2 | Not Selected | 0 | Room_Type 1 | 6.0 | 2019 | 4 | 28 | Online | 0 | 0 | 0 | 162.50 | 2 | 0.0 |
| 56925 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 207.0 | 2018 | 12 | 30 | Offline | 0 | 0 | 0 | 161.67 | 0 | 0.0 |
56926 rows × 18 columns
treat_outliers(df,'no_of_week_nights')
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | type_of_meal_plan | required_car_parking_space | room_type_reserved | lead_time | arrival_year | arrival_month | arrival_date | market_segment_type | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | booking_status | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 224.0 | 2017 | 10 | 2 | Offline | 0 | 0 | 0 | 65.00 | 0 | 0.0 |
| 1 | 2 | 0 | 2 | 3 | Not Selected | 0 | Room_Type 1 | 5.0 | 2018 | 11 | 6 | Online | 0 | 0 | 0 | 106.68 | 1 | 0.0 |
| 2 | 1 | 0 | 2 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 1.0 | 2018 | 2 | 28 | Online | 0 | 0 | 0 | 60.00 | 0 | 1.0 |
| 3 | 2 | 0 | 0 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 211.0 | 2018 | 5 | 20 | Online | 0 | 0 | 0 | 100.00 | 0 | 1.0 |
| 4 | 3 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 277.0 | 2019 | 7 | 13 | Online | 0 | 0 | 0 | 89.10 | 2 | 1.0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 56921 | 2 | 1 | 0 | 1 | Meal Plan 2 | 0 | Room_Type 4 | 45.0 | 2019 | 6 | 15 | Online | 0 | 0 | 0 | 163.88 | 1 | 0.0 |
| 56922 | 2 | 0 | 1 | 1 | Meal Plan 1 | 0 | Room_Type 1 | 320.0 | 2019 | 5 | 15 | Offline | 0 | 0 | 0 | 90.00 | 1 | 1.0 |
| 56923 | 2 | 0 | 0 | 3 | Not Selected | 0 | Room_Type 1 | 63.0 | 2018 | 4 | 21 | Online | 0 | 0 | 0 | 94.50 | 0 | 1.0 |
| 56924 | 2 | 0 | 2 | 2 | Not Selected | 0 | Room_Type 1 | 6.0 | 2019 | 4 | 28 | Online | 0 | 0 | 0 | 162.50 | 2 | 0.0 |
| 56925 | 2 | 0 | 1 | 2 | Meal Plan 1 | 0 | Room_Type 1 | 207.0 | 2018 | 12 | 30 | Offline | 0 | 0 | 0 | 161.67 | 0 | 0.0 |
56926 rows × 18 columns
we replace canceled and not canceled by 1 and 0, respectively, as we are focusing on Cancellation motivations
X = df.drop('booking_status', axis=1)
y = df['booking_status']
X.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 56926 entries, 0 to 56925 Data columns (total 17 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 no_of_adults 56926 non-null int64 1 no_of_children 56926 non-null int64 2 no_of_weekend_nights 56926 non-null int64 3 no_of_week_nights 56926 non-null int64 4 type_of_meal_plan 56926 non-null object 5 required_car_parking_space 56926 non-null int64 6 room_type_reserved 56926 non-null object 7 lead_time 56926 non-null float64 8 arrival_year 56926 non-null int64 9 arrival_month 56926 non-null int64 10 arrival_date 56926 non-null int64 11 market_segment_type 56926 non-null object 12 repeated_guest 56926 non-null int64 13 no_of_previous_cancellations 56926 non-null int64 14 no_of_previous_bookings_not_canceled 56926 non-null int64 15 avg_price_per_room 56926 non-null float64 16 no_of_special_requests 56926 non-null int64 dtypes: float64(2), int64(12), object(3) memory usage: 7.4+ MB
X['type_of_meal_plan'] = X['type_of_meal_plan'].astype('category')
X['room_type_reserved'] = X['room_type_reserved'].astype('category')
X['market_segment_type'] = X['market_segment_type'].astype('category')
X.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 56926 entries, 0 to 56925 Data columns (total 17 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 no_of_adults 56926 non-null int64 1 no_of_children 56926 non-null int64 2 no_of_weekend_nights 56926 non-null int64 3 no_of_week_nights 56926 non-null int64 4 type_of_meal_plan 56926 non-null category 5 required_car_parking_space 56926 non-null int64 6 room_type_reserved 56926 non-null category 7 lead_time 56926 non-null float64 8 arrival_year 56926 non-null int64 9 arrival_month 56926 non-null int64 10 arrival_date 56926 non-null int64 11 market_segment_type 56926 non-null category 12 repeated_guest 56926 non-null int64 13 no_of_previous_cancellations 56926 non-null int64 14 no_of_previous_bookings_not_canceled 56926 non-null int64 15 avg_price_per_room 56926 non-null float64 16 no_of_special_requests 56926 non-null int64 dtypes: category(3), float64(2), int64(12) memory usage: 6.2 MB
X = pd.get_dummies(X, columns=['type_of_meal_plan', 'room_type_reserved', 'market_segment_type'], drop_first=True)
X.head()
| no_of_adults | no_of_children | no_of_weekend_nights | no_of_week_nights | required_car_parking_space | lead_time | arrival_year | arrival_month | arrival_date | repeated_guest | no_of_previous_cancellations | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | type_of_meal_plan_Meal Plan 2 | type_of_meal_plan_Meal Plan 3 | type_of_meal_plan_Not Selected | room_type_reserved_Room_Type 2 | room_type_reserved_Room_Type 3 | room_type_reserved_Room_Type 4 | room_type_reserved_Room_Type 5 | room_type_reserved_Room_Type 6 | room_type_reserved_Room_Type 7 | market_segment_type_Complementary | market_segment_type_Corporate | market_segment_type_Offline | market_segment_type_Online | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2 | 0 | 1 | 2 | 0 | 224.0 | 2017 | 10 | 2 | 0 | 0 | 0 | 65.00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| 1 | 2 | 0 | 2 | 3 | 0 | 5.0 | 2018 | 11 | 6 | 0 | 0 | 0 | 106.68 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| 2 | 1 | 0 | 2 | 1 | 0 | 1.0 | 2018 | 2 | 28 | 0 | 0 | 0 | 60.00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| 3 | 2 | 0 | 0 | 2 | 0 | 211.0 | 2018 | 5 | 20 | 0 | 0 | 0 | 100.00 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| 4 | 3 | 0 | 0 | 3 | 0 | 277.0 | 2019 | 7 | 13 | 0 | 0 | 0 | 89.10 | 2 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
# Splitting data in train and test sets
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.30, random_state=1
)
print("Shape of Training set : ", X_train.shape)
print("Shape of test set : ", X_test.shape)
print("Percentage of classes in training set:")
print(y_train.value_counts(normalize=True))
print("Percentage of classes in test set:")
print(y_test.value_counts(normalize=True))
Shape of Training set : (39848, 27) Shape of test set : (17078, 27) Percentage of classes in training set: 0.0 0.620684 1.0 0.379316 Name: booking_status, dtype: float64 Percentage of classes in test set: 0.0 0.623317 1.0 0.376683 Name: booking_status, dtype: float64
Sklearn Model Results
# There are different solvers available in Sklearn logistic regression
# The newton-cg solver is faster for high-dimensional data
lg = LogisticRegression(solver="newton-cg", random_state=1)
model = lg.fit(X_train, y_train)
Checking performance on train set
# predicting on training set
y_pred_train = lg.predict(X_train)
from sklearn.metrics import classification_report
print(classification_report(y_train, y_pred_train))
precision recall f1-score support
0.0 0.81 0.86 0.83 24733
1.0 0.74 0.66 0.70 15115
accuracy 0.79 39848
macro avg 0.78 0.76 0.77 39848
weighted avg 0.78 0.79 0.78 39848
Checking performance on test set
# predicting on the test set
y_pred_test = lg.predict(X_test)
print(classification_report(y_test, y_pred_test))
precision recall f1-score support
0.0 0.81 0.87 0.84 10645
1.0 0.75 0.67 0.71 6433
accuracy 0.79 17078
macro avg 0.78 0.77 0.77 17078
weighted avg 0.79 0.79 0.79 17078
def confusion_matrix_sklearn(model, predictors, target):
"""
To plot the confusion_matrix with percentages
model: classifier
predictors: independent variables
target: dependent variable
"""
y_pred = model.predict(predictors)
cm = confusion_matrix(target, y_pred)
labels = np.asarray(
[
["{0:0.0f}".format(item) + "\n{0:.2%}".format(item / cm.flatten().sum())]
for item in cm.flatten()
]
).reshape(2, 2)
plt.figure(figsize=(6, 4))
sns.heatmap(cm, annot=labels, fmt="")
plt.ylabel("True label")
plt.xlabel("Predicted label")
# defining a function to plot the confusion_matrix of a classification model
def confusion_matrix_statsmodels(model, predictors, target, threshold=0.5):
"""
To plot the confusion_matrix with percentages
model: classifier
predictors: independent variables
target: dependent variable
threshold: threshold for classifying the observation as class 1
"""
y_pred = model.predict(predictors) > threshold
cm = confusion_matrix(target, y_pred)
labels = np.asarray(
[
["{0:0.0f}".format(item) + "\n{0:.2%}".format(item / cm.flatten().sum())]
for item in cm.flatten()
]
).reshape(2, 2)
plt.figure(figsize=(6, 4))
sns.heatmap(cm, annot=labels, fmt="")
plt.ylabel("True label")
plt.xlabel("Predicted label")
confusion_matrix_sklearn(model, X_train, y_train)
Observations
Statsmodel results
X = df.drop('booking_status', axis=1)
y = df['booking_status']
X['type_of_meal_plan'] = X['type_of_meal_plan'].astype('category')
X['room_type_reserved'] = X['room_type_reserved'].astype('category')
X['market_segment_type'] = X['market_segment_type'].astype('category')
X = pd.get_dummies(X, columns=['type_of_meal_plan', 'room_type_reserved', 'market_segment_type'], drop_first=True)
# adding constant
X = sm.add_constant(X)
# Splitting data in train and test sets
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.30, random_state=1
)
# defining a function to compute different metrics to check performance of a classification model built using statsmodels
def model_performance_classification_statsmodels(
model, predictors, target, threshold=0.5):
"""
Function to compute different metrics to check classification model performance
model: classifier
predictors: independent variables
target: dependent variable
threshold: threshold for classifying the observation as class 1
"""
# checking which probabilities are greater than threshold
pred_temp = model.predict(predictors) > threshold
# rounding off the above values to get classes
pred = np.round(pred_temp)
target = target.astype('float')
acc = accuracy_score(target, pred) # to compute Accuracy
recall = recall_score(target, pred) # to compute Recall
precision = precision_score(target, pred) # to compute Precision
f1 = f1_score(target, pred) # to compute F1-score
# creating a dataframe of metrics
df_perf = pd.DataFrame(
{"Accuracy": acc, "Recall": recall, "Precision": precision, "F1": f1,},
index=[0],
)
return df_perf
# fitting logistic regression model
logit = sm.Logit(y_train.astype('float'), X_train)
lg = logit.fit(method='bfgs')#matrix det is 0 so the Hessian is negative as it's a singular matrix. We have to use the bfgs method in order to correct this.
#np.asarray(lg)
print(lg.summary())
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445241
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Logit Regression Results
==============================================================================
Dep. Variable: booking_status No. Observations: 39848
Model: Logit Df Residuals: 39820
Method: MLE Df Model: 27
Date: Fri, 22 Oct 2021 Pseudo R-squ.: 0.3292
Time: 23:16:36 Log-Likelihood: -17742.
converged: False LL-Null: -26448.
Covariance Type: nonrobust LLR p-value: 0.000
========================================================================================================
coef std err z P>|z| [0.025 0.975]
--------------------------------------------------------------------------------------------------------
const -0.0008 56.794 -1.47e-05 1.000 -111.315 111.313
no_of_adults 0.0246 0.030 0.834 0.404 -0.033 0.083
no_of_children -0.1132 0.047 -2.390 0.017 -0.206 -0.020
no_of_weekend_nights 0.0865 0.015 5.667 0.000 0.057 0.116
no_of_week_nights 0.0179 0.010 1.709 0.087 -0.003 0.038
required_car_parking_space -1.2385 0.108 -11.509 0.000 -1.449 -1.028
lead_time 0.0170 0.000 80.323 0.000 0.017 0.017
arrival_year -0.0017 0.028 -0.061 0.951 -0.057 0.053
arrival_month -0.0649 0.006 -11.174 0.000 -0.076 -0.053
arrival_date 0.0004 0.002 0.265 0.791 -0.003 0.003
repeated_guest -0.3248 0.304 -1.068 0.286 -0.921 0.271
no_of_previous_cancellations 0.1371 0.070 1.953 0.051 -0.001 0.275
no_of_previous_bookings_not_canceled -0.4542 0.155 -2.940 0.003 -0.757 -0.151
avg_price_per_room 0.0202 0.001 34.682 0.000 0.019 0.021
no_of_special_requests -1.3296 0.021 -62.144 0.000 -1.372 -1.288
type_of_meal_plan_Meal Plan 2 -0.1036 0.055 -1.898 0.058 -0.211 0.003
type_of_meal_plan_Meal Plan 3 0.0059 1.882 0.003 0.997 -3.682 3.694
type_of_meal_plan_Not Selected 0.2514 0.039 6.407 0.000 0.174 0.328
room_type_reserved_Room_Type 2 -0.2199 0.117 -1.878 0.060 -0.449 0.010
room_type_reserved_Room_Type 3 -0.0006 3.811 -0.000 1.000 -7.471 7.470
room_type_reserved_Room_Type 4 -0.3455 0.041 -8.428 0.000 -0.426 -0.265
room_type_reserved_Room_Type 5 -0.2635 0.102 -2.580 0.010 -0.464 -0.063
room_type_reserved_Room_Type 6 -0.2832 0.115 -2.464 0.014 -0.508 -0.058
room_type_reserved_Room_Type 7 -0.1240 0.183 -0.679 0.497 -0.482 0.234
market_segment_type_Complementary -0.0669 0.505 -0.133 0.895 -1.056 0.922
market_segment_type_Corporate 0.3780 0.257 1.473 0.141 -0.125 0.881
market_segment_type_Offline -1.0561 0.252 -4.187 0.000 -1.550 -0.562
market_segment_type_Online 0.6353 0.250 2.539 0.011 0.145 1.126
========================================================================================================
model_performance_classification_statsmodels(lg, X_train, y_train)
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.784883 | 0.659411 | 0.744306 | 0.699291 |
Observations
These variable may have some multicolinearity which affect each one
We will have to remove multicollinearity from the data to get reliable coefficients and p-values.
There are different ways of detecting (or testing) multi-collinearity, one such way is the Variation Inflation Factor.
Variance Inflation factor: Variance inflation factors measure the inflation in the variances of the regression coefficients estimates due to collinearities that exist among the predictors. It is a measure of how much the variance of the estimated regression coefficient βk is “inflated”by the existence of correlation among the predictor variables in the model.
General Rule of thumb: If VIF is 1 then there is no correlation among the kth predictor and the remaining predictor variables, and hence the variance of β̂k is not inflated at all. Whereas if VIF exceeds 5, we say there is moderate VIF and if it is 10 or exceeding 10, it shows signs of high multi-collinearity. But the purpose of the analysis should dictate which threshold to use.
vif_series = pd.Series(
[variance_inflation_factor(X_train.values, i) for i in range(X_train.shape[1])],
index=X_train.columns,
dtype=float,
)
print("Series before feature selection: \n\n{}\n".format(vif_series))
Series before feature selection: const 1.813087e+07 no_of_adults 1.382964e+00 no_of_children 2.052536e+00 no_of_weekend_nights 1.053071e+00 no_of_week_nights 1.088901e+00 required_car_parking_space 1.038417e+00 lead_time 1.361787e+00 arrival_year 1.860909e+00 arrival_month 1.565470e+00 arrival_date 1.004797e+00 repeated_guest 1.833490e+00 no_of_previous_cancellations 1.457326e+00 no_of_previous_bookings_not_canceled 1.781120e+00 avg_price_per_room 2.217942e+00 no_of_special_requests 1.180150e+00 type_of_meal_plan_Meal Plan 2 1.186202e+00 type_of_meal_plan_Meal Plan 3 1.022844e+00 type_of_meal_plan_Not Selected 1.356249e+00 room_type_reserved_Room_Type 2 1.085566e+00 room_type_reserved_Room_Type 3 1.001074e+00 room_type_reserved_Room_Type 4 1.423995e+00 room_type_reserved_Room_Type 5 1.102848e+00 room_type_reserved_Room_Type 6 2.020251e+00 room_type_reserved_Room_Type 7 1.119158e+00 market_segment_type_Complementary 3.549954e+00 market_segment_type_Corporate 1.286792e+01 market_segment_type_Offline 4.901538e+01 market_segment_type_Online 5.591070e+01 dtype: float64
Observations
X_train1 = X_train.drop("market_segment_type_Online", axis=1)
vif_series2 = pd.Series(
[variance_inflation_factor(X_train1.values, i) for i in range(X_train1.shape[1])],
index=X_train1.columns,
)
print("Series before feature selection: \n\n{}\n".format(vif_series2))
Series before feature selection: const 1.809503e+07 no_of_adults 1.364480e+00 no_of_children 2.051708e+00 no_of_weekend_nights 1.052623e+00 no_of_week_nights 1.088865e+00 required_car_parking_space 1.038417e+00 lead_time 1.357486e+00 arrival_year 1.857807e+00 arrival_month 1.564453e+00 arrival_date 1.004738e+00 repeated_guest 1.803906e+00 no_of_previous_cancellations 1.456634e+00 no_of_previous_bookings_not_canceled 1.778869e+00 avg_price_per_room 2.216433e+00 no_of_special_requests 1.176191e+00 type_of_meal_plan_Meal Plan 2 1.186074e+00 type_of_meal_plan_Meal Plan 3 1.022844e+00 type_of_meal_plan_Not Selected 1.353109e+00 room_type_reserved_Room_Type 2 1.085403e+00 room_type_reserved_Room_Type 3 1.001068e+00 room_type_reserved_Room_Type 4 1.419391e+00 room_type_reserved_Room_Type 5 1.102752e+00 room_type_reserved_Room_Type 6 2.019982e+00 room_type_reserved_Room_Type 7 1.119022e+00 market_segment_type_Complementary 1.288748e+00 market_segment_type_Corporate 1.514949e+00 market_segment_type_Offline 1.553964e+00 dtype: float64
Observations
logit2 = sm.Logit(y_train.astype('float'), X_train1)
lg2 = logit2.fit(method='bfgs')
print("Training performance:")
model_performance_classification_statsmodels(lg2, X_train1, y_train)
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445516
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Training performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.784857 | 0.660337 | 0.743741 | 0.699562 |
Observations
print(lg2.summary())
Logit Regression Results
==============================================================================
Dep. Variable: booking_status No. Observations: 39848
Model: Logit Df Residuals: 39821
Method: MLE Df Model: 26
Date: Fri, 22 Oct 2021 Pseudo R-squ.: 0.3288
Time: 23:16:38 Log-Likelihood: -17753.
converged: False LL-Null: -26448.
Covariance Type: nonrobust LLR p-value: 0.000
========================================================================================================
coef std err z P>|z| [0.025 0.975]
--------------------------------------------------------------------------------------------------------
const -0.0007 57.103 -1.19e-05 1.000 -111.920 111.919
no_of_adults 0.0389 0.029 1.328 0.184 -0.018 0.096
no_of_children -0.0893 0.047 -1.900 0.057 -0.181 0.003
no_of_weekend_nights 0.0969 0.015 6.372 0.000 0.067 0.127
no_of_week_nights -0.0025 0.010 -0.237 0.813 -0.023 0.018
required_car_parking_space -1.0177 0.103 -9.864 0.000 -1.220 -0.815
lead_time 0.0170 0.000 80.430 0.000 0.017 0.017
arrival_year -0.0014 0.028 -0.049 0.961 -0.057 0.054
arrival_month -0.0641 0.006 -11.066 0.000 -0.075 -0.053
arrival_date 0.0004 0.002 0.247 0.805 -0.003 0.003
repeated_guest -0.3286 0.308 -1.067 0.286 -0.932 0.275
no_of_previous_cancellations 0.1145 0.070 1.639 0.101 -0.022 0.252
no_of_previous_bookings_not_canceled -0.4939 0.169 -2.925 0.003 -0.825 -0.163
avg_price_per_room 0.0195 0.001 33.759 0.000 0.018 0.021
no_of_special_requests -1.3182 0.021 -61.976 0.000 -1.360 -1.277
type_of_meal_plan_Meal Plan 2 -0.0713 0.054 -1.310 0.190 -0.178 0.035
type_of_meal_plan_Meal Plan 3 0.0044 1.764 0.002 0.998 -3.452 3.461
type_of_meal_plan_Not Selected 0.2454 0.039 6.277 0.000 0.169 0.322
room_type_reserved_Room_Type 2 -0.1396 0.116 -1.202 0.229 -0.367 0.088
room_type_reserved_Room_Type 3 -0.0007 4.027 -0.000 1.000 -7.893 7.892
room_type_reserved_Room_Type 4 -0.3033 0.041 -7.452 0.000 -0.383 -0.224
room_type_reserved_Room_Type 5 -0.2420 0.102 -2.376 0.018 -0.442 -0.042
room_type_reserved_Room_Type 6 -0.2499 0.114 -2.185 0.029 -0.474 -0.026
room_type_reserved_Room_Type 7 -0.1205 0.182 -0.662 0.508 -0.478 0.237
market_segment_type_Complementary -0.0863 0.335 -0.258 0.797 -0.743 0.570
market_segment_type_Corporate -0.3370 0.078 -4.335 0.000 -0.489 -0.185
market_segment_type_Offline -1.6944 0.042 -40.403 0.000 -1.777 -1.612
========================================================================================================
Many attributes have a p-value higher than the 0.05 cut-off, it concerns numerical variables (no_of_adults, no_of_children, no_of_week_night, arrival_year, arrival date, repeated_guest, no_of_previous_cancellations) and many dummies variables also. We'll not drop all variables at once.
Instead, we will do the following repeatedly using a loop:
Note: The above process can also be done manually by picking one variable at a time that has a high p-value, dropping it, and building a model again. But that might be a little tedious and using a loop will be more efficient.
# running a loop to drop variables with high p-value
# initial list of columns
cols = X_train1.columns.tolist()
# setting an initial max p-value
max_p_value = 1
while len(cols) > 0:
# defining the train set
X_train_aux = X_train1[cols]
# fitting the model
model = sm.Logit(y_train.astype('float'), X_train_aux).fit(method='bfgs')
# getting the p-values and the maximum p-value
p_values = model.pvalues
max_p_value = max(p_values)
# name of the variable with maximum p-value
feature_with_p_max = p_values.idxmax()
if max_p_value > 0.05:
cols.remove(feature_with_p_max)
else:
break
selected_features = cols
print(selected_features)
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445516
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445516
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445516
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445516
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445524
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445494
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445518
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445565
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445758
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445831
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445905
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445939
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
['no_of_adults', 'no_of_children', 'no_of_weekend_nights', 'required_car_parking_space', 'lead_time', 'arrival_year', 'arrival_month', 'no_of_previous_bookings_not_canceled', 'avg_price_per_room', 'no_of_special_requests', 'type_of_meal_plan_Not Selected', 'room_type_reserved_Room_Type 4', 'room_type_reserved_Room_Type 5', 'room_type_reserved_Room_Type 6', 'market_segment_type_Corporate', 'market_segment_type_Offline']
X_train2 = X_train1[selected_features]
logit3 = sm.Logit(y_train.astype('float'), X_train2)
lg3 = logit3.fit(method='bfgs')
print(lg3.summary())
Warning: Maximum number of iterations has been exceeded.
Current function value: 0.445939
Iterations: 35
Function evaluations: 45
Gradient evaluations: 39
Logit Regression Results
==============================================================================
Dep. Variable: booking_status No. Observations: 39848
Model: Logit Df Residuals: 39832
Method: MLE Df Model: 15
Date: Fri, 22 Oct 2021 Pseudo R-squ.: 0.3281
Time: 23:16:39 Log-Likelihood: -17770.
converged: False LL-Null: -26448.
Covariance Type: nonrobust LLR p-value: 0.000
========================================================================================================
coef std err z P>|z| [0.025 0.975]
--------------------------------------------------------------------------------------------------------
no_of_adults 0.0583 0.029 2.006 0.045 0.001 0.115
no_of_children -0.1014 0.045 -2.257 0.024 -0.189 -0.013
no_of_weekend_nights 0.0840 0.015 5.542 0.000 0.054 0.114
required_car_parking_space -1.0747 0.104 -10.319 0.000 -1.279 -0.871
lead_time 0.0170 0.000 85.571 0.000 0.017 0.017
arrival_year -0.0014 3.9e-05 -35.699 0.000 -0.001 -0.001
arrival_month -0.0649 0.005 -13.524 0.000 -0.074 -0.056
no_of_previous_bookings_not_canceled -0.5569 0.121 -4.584 0.000 -0.795 -0.319
avg_price_per_room 0.0196 0.001 38.274 0.000 0.019 0.021
no_of_special_requests -1.3350 0.021 -62.514 0.000 -1.377 -1.293
type_of_meal_plan_Not Selected 0.2412 0.038 6.359 0.000 0.167 0.316
room_type_reserved_Room_Type 4 -0.2969 0.040 -7.391 0.000 -0.376 -0.218
room_type_reserved_Room_Type 5 -0.2408 0.101 -2.373 0.018 -0.440 -0.042
room_type_reserved_Room_Type 6 -0.2493 0.110 -2.272 0.023 -0.464 -0.034
market_segment_type_Corporate -0.3855 0.078 -4.956 0.000 -0.538 -0.233
market_segment_type_Offline -1.7090 0.041 -41.920 0.000 -1.789 -1.629
========================================================================================================
Now that every variable as a pvalue < 0.05 so we'll consider the features in X_train2 as the final ones and lg3 as final model.
Coefficient interpretation
At this point the more adults, week end nights, lead time and avg price, the more the cancellation probability increase. On the negative side the no of children, required car parking race, time of arrival either year or month. This indicate more a corporate profile. This is confirmed by the market segment influence, Corporate or Offline, which tends to decrease the probability of cancellation. This confirm our hypothesis : families have a higher cancellation probability than the others
# converting coefficients to odds
odds = np.exp(lg3.params)
# finding the percentage change
perc_change_odds = (np.exp(lg3.params) - 1) * 100
# removing limit from number of columns to display
pd.set_option("display.max_columns", None)
# adding the odds to a dataframe
pd.DataFrame({"Odds": odds, "Change_odd%": perc_change_odds}, index=X_train2.columns).T
| no_of_adults | no_of_children | no_of_weekend_nights | required_car_parking_space | lead_time | arrival_year | arrival_month | no_of_previous_bookings_not_canceled | avg_price_per_room | no_of_special_requests | type_of_meal_plan_Not Selected | room_type_reserved_Room_Type 4 | room_type_reserved_Room_Type 5 | room_type_reserved_Room_Type 6 | market_segment_type_Corporate | market_segment_type_Offline | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Odds | 1.060034 | 0.903568 | 1.087594 | 0.341400 | 1.017121 | 0.998608 | 0.937122 | 0.572975 | 1.019748 | 0.263151 | 1.272802 | 0.743118 | 0.785988 | 0.779345 | 0.680119 | 0.181042 |
| Change_odd% | 6.003393 | -9.643151 | 8.759382 | -65.860027 | 1.712089 | -0.139194 | -6.287775 | -42.702508 | 1.974805 | -73.684883 | 27.280182 | -25.688232 | -21.401204 | -22.065496 | -31.988147 | -81.895837 |
Coefficient interpretation
# creating confusion matrix
confusion_matrix_statsmodels(lg3, X_train2, y_train.astype('float'))
log_reg_model_train_perf = model_performance_classification_statsmodels(
lg3, X_train2, y_train
)
print("Training performance:")
log_reg_model_train_perf
Training performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.785585 | 0.658948 | 0.746123 | 0.699831 |
logit_roc_auc_train = roc_auc_score(y_train.astype('float'), lg3.predict(X_train2))
fpr, tpr, thresholds = roc_curve(y_train.astype('float'), lg3.predict(X_train2))
plt.figure(figsize=(7, 5))
plt.plot(fpr, tpr, label="Logistic Regression (area = %0.2f)" % logit_roc_auc_train)
plt.plot([0, 1], [0, 1], "r--")
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel("False Positive Rate")
plt.ylabel("True Positive Rate")
plt.title("Receiver operating characteristic")
plt.legend(loc="lower right")
plt.show()
Logistic model is giving good performance on training set
# Optimal threshold as per AUC-ROC curve
# The optimal cut off would be where tpr is high and fpr is low
fpr, tpr, thresholds = roc_curve(y_train.astype('float'), lg3.predict(X_train2))
optimal_idx = np.argmax(tpr - fpr)
optimal_threshold_auc_roc = thresholds[optimal_idx]
print(optimal_threshold_auc_roc)
0.3250501795925055
# checking model performance for this model
log_reg_model_train_perf_threshold_auc_roc = model_performance_classification_statsmodels(
lg3, X_train2, y_train.astype('float'), threshold=optimal_threshold_auc_roc
)
print("Training performance:")
log_reg_model_train_perf_threshold_auc_roc
Training performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.768646 | 0.811512 | 0.658188 | 0.726853 |
y_scores = lg3.predict(X_train2)
prec, rec, tre = precision_recall_curve(y_train.astype('float'), y_scores.astype('float'),)
def plot_prec_recall_vs_tresh(precisions, recalls, thresholds):
plt.plot(thresholds, precisions[:-1], "b--", label="precision")
plt.plot(thresholds, recalls[:-1], "g--", label="recall")
plt.xlabel("Threshold")
plt.legend(loc="upper left")
plt.ylim([0, 1])
plt.figure(figsize=(10, 7))
plot_prec_recall_vs_tresh(prec, rec, tre)
plt.show()
The optimal Threshold seems to be at 0.42
# setting the threshold
optimal_threshold_curve = 0.42
# creating confusion matrix
confusion_matrix_statsmodels(lg3, X_train2, y_train.astype('float'), threshold=optimal_threshold_curve)
log_reg_model_train_perf_threshold_curve = model_performance_classification_statsmodels(
lg3, X_train2, y_train.astype('float'), threshold=optimal_threshold_curve
)
print("Training performance:")
log_reg_model_train_perf_threshold_curve
Training performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.784431 | 0.72782 | 0.710797 | 0.719208 |
# training performance comparison
models_train_comp_df = pd.concat(
[
log_reg_model_train_perf.T,
log_reg_model_train_perf_threshold_auc_roc.T,
log_reg_model_train_perf_threshold_curve.T,
],
axis=1,
)
models_train_comp_df.columns = [
"Logistic Regression sklearn",
"Logistic Regression-0.32 Threshold",
"Logistic Regression-0.42 Threshold",
]
print("Training performance comparison:")
models_train_comp_df
Training performance comparison:
| Logistic Regression sklearn | Logistic Regression-0.32 Threshold | Logistic Regression-0.42 Threshold | |
|---|---|---|---|
| Accuracy | 0.785585 | 0.768646 | 0.784431 |
| Recall | 0.658948 | 0.811512 | 0.727820 |
| Precision | 0.746123 | 0.658188 | 0.710797 |
| F1 | 0.699831 | 0.726853 | 0.719208 |
The 0.32 Threshold looks more attractive in terms of performance
X_test2 = X_test[list(X_train2.columns)]
# creating confusion matrix
confusion_matrix_statsmodels(lg3, X_test2, y_test.astype('float'))
log_reg_model_test_perf = model_performance_classification_statsmodels(
lg3, X_test2, y_test.astype('float')
)
print("Test performance:")
log_reg_model_test_perf
Test performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.792774 | 0.666252 | 0.754843 | 0.707786 |
logit_roc_auc_train = roc_auc_score(y_test.astype('float'), lg3.predict(X_test2))
fpr, tpr, thresholds = roc_curve(y_test.astype('float'), lg3.predict(X_test2))
plt.figure(figsize=(7, 5))
plt.plot(fpr, tpr, label="Logistic Regression (area = %0.2f)" % logit_roc_auc_train)
plt.plot([0, 1], [0, 1], "r--")
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel("False Positive Rate")
plt.ylabel("True Positive Rate")
plt.title("Receiver operating characteristic")
plt.legend(loc="lower right")
plt.show()
Using model threshold 0.42
# creating confusion matrix
confusion_matrix_statsmodels(lg3, X_test2, y_test.astype('float'), threshold=optimal_threshold_auc_roc)
# checking model performance for this model
log_reg_model_test_perf_threshold_auc_roc = model_performance_classification_statsmodels(
lg3, X_test2, y_test.astype('float'), threshold=optimal_threshold_auc_roc
)
print("Test performance:")
log_reg_model_test_perf_threshold_auc_roc
Test performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.771929 | 0.814395 | 0.659824 | 0.729006 |
Using model thresholds 0.42
# creating confusion matrix
confusion_matrix_statsmodels(lg3, X_test2, y_test.astype('float'), threshold=optimal_threshold_curve)
# checking model performance for this model
log_reg_model_test_perf_threshold_curve = model_performance_classification_statsmodels(
lg3, X_test2, y_test.astype('float'), threshold=optimal_threshold_curve
)
print("Test performance:")
log_reg_model_test_perf_threshold_curve
Test performance:
| Accuracy | Recall | Precision | F1 | |
|---|---|---|---|---|
| 0 | 0.787622 | 0.732629 | 0.711934 | 0.722133 |
# training performance comparison
models_train_comp_df = pd.concat(
[
log_reg_model_train_perf.T,
log_reg_model_train_perf_threshold_auc_roc.T,
log_reg_model_train_perf_threshold_curve.T,
],
axis=1,
)
models_train_comp_df.columns = [
"Logistic Regression sklearn",
"Logistic Regression-0.32 Threshold",
"Logistic Regression-0.42 Threshold",
]
print("Training performance comparison:")
models_train_comp_df
Training performance comparison:
| Logistic Regression sklearn | Logistic Regression-0.32 Threshold | Logistic Regression-0.42 Threshold | |
|---|---|---|---|
| Accuracy | 0.785585 | 0.768646 | 0.784431 |
| Recall | 0.658948 | 0.811512 | 0.727820 |
| Precision | 0.746123 | 0.658188 | 0.710797 |
| F1 | 0.699831 | 0.726853 | 0.719208 |
# testing performance comparison
models_test_comp_df = pd.concat(
[
log_reg_model_test_perf.T,
log_reg_model_test_perf_threshold_auc_roc.T,
log_reg_model_test_perf_threshold_curve.T,
],
axis=1,
)
models_test_comp_df.columns = [
"Logistic Regression sklearn",
"Logistic Regression-0.32 Threshold",
"Logistic Regression-0.42 Threshold",
]
print("Test set performance comparison:")
models_test_comp_df
Test set performance comparison:
| Logistic Regression sklearn | Logistic Regression-0.32 Threshold | Logistic Regression-0.42 Threshold | |
|---|---|---|---|
| Accuracy | 0.792774 | 0.771929 | 0.787622 |
| Recall | 0.666252 | 0.814395 | 0.732629 |
| Precision | 0.754843 | 0.659824 | 0.711934 |
| F1 | 0.707786 | 0.729006 | 0.722133 |
Conclusions
The best model looks to be the 0.32 threshold one with the highest recall
Recommandations
## Function to calculate recall score
def get_recall_score(model, predictors, target):
"""
model: classifier
predictors: independent variables
target: dependent variable
"""
prediction = model.predict(predictors)
return recall_score(target, prediction)
model = DecisionTreeClassifier(
criterion="gini", random_state=1
)
model.fit(X_train, y_train)
DecisionTreeClassifier(random_state=1)
confusion_matrix_sklearn(model, X_train, y_train)
y_train_pred2 = model.predict(X_train)
decision_tree_perf_train = recall_score(y_train.astype('float'), y_train_pred2.astype('float'))
decision_tree_perf_train
0.9883559378101224
confusion_matrix_sklearn(model, X_test, y_test)
y_pred_test2 = model.predict(X_test)
decision_tree_perf_test = recall_score(y_test.astype('float'), y_pred_test2.astype('float'))
decision_tree_perf_test
0.8028913415202861
As anticipated there is a huge difference in performance between the train and the test set, suggesting an overfitting of the model
## creating a list of column names
feature_names = X_train.columns.to_list()
plt.figure(figsize=(20, 30))
out = tree.plot_tree(
model,
feature_names=feature_names,
filled=True,
fontsize=9,
node_ids=False,
class_names=None,
)
# below code will add arrows to the decision tree split if they are missing
for o in out:
arrow = o.arrow_patch
if arrow is not None:
arrow.set_edgecolor("black")
arrow.set_linewidth(1)
plt.show()
# Text report showing the rules of a decision tree -
print(tree.export_text(model, feature_names=feature_names, show_weights=True))
|--- lead_time <= 151.50 | |--- no_of_special_requests <= 0.50 | | |--- market_segment_type_Online <= 0.50 | | | |--- lead_time <= 88.50 | | | | |--- arrival_month <= 6.50 | | | | | |--- lead_time <= 36.50 | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | |--- arrival_date <= 21.50 | | | | | | | | |--- avg_price_per_room <= 195.12 | | | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | |--- avg_price_per_room > 195.12 | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- arrival_date > 21.50 | | | | | | | | |--- avg_price_per_room <= 62.45 | | | | | | | | | |--- avg_price_per_room <= 59.75 | | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- avg_price_per_room > 59.75 | | | | | | | | | | |--- weights: [0.00, 37.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 62.45 | | | | | | | | | |--- avg_price_per_room <= 97.50 | | | | | | | | | | |--- lead_time <= 34.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- lead_time > 34.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- avg_price_per_room > 97.50 | | | | | | | | | | |--- lead_time <= 19.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- lead_time > 19.50 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | |--- arrival_date <= 13.50 | | | | | | | | |--- weights: [0.00, 10.00] class: 1.0 | | | | | | | |--- arrival_date > 13.50 | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | |--- arrival_date <= 15.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 15.50 | | | | | | | | | | |--- arrival_month <= 3.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_month > 3.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | |--- lead_time > 36.50 | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | |--- weights: [481.00, 0.00] class: 0.0 | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | |--- arrival_date <= 14.00 | | | | | | | | | | |--- avg_price_per_room <= 78.25 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 78.25 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_date > 14.00 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [13.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | |--- arrival_date <= 16.50 | | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- arrival_date > 16.50 | | | | | | | | | | |--- arrival_date <= 25.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- arrival_date > 25.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | |--- avg_price_per_room <= 85.25 | | | | | | | | |--- avg_price_per_room <= 72.67 | | | | | | | | | |--- no_of_previous_bookings_not_canceled <= 9.50 | | | | | | | | | | |--- weights: [15.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_previous_bookings_not_canceled > 9.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 72.67 | | | | | | | | | |--- weights: [0.00, 89.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 85.25 | | | | | | | | |--- avg_price_per_room <= 132.70 | | | | | | | | | |--- lead_time <= 38.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- lead_time > 38.50 | | | | | | | | | | |--- arrival_date <= 29.00 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_date > 29.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 132.70 | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | |--- arrival_month > 6.50 | | | | | |--- avg_price_per_room <= 195.78 | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | |--- market_segment_type_Offline <= 0.50 | | | | | | | | |--- arrival_date <= 29.50 | | | | | | | | | |--- lead_time <= 86.50 | | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | | |--- weights: [87.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 86.50 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 29.50 | | | | | | | | | |--- avg_price_per_room <= 88.50 | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 88.50 | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | |--- market_segment_type_Offline > 0.50 | | | | | | | | |--- weights: [1116.00, 0.00] class: 0.0 | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | |--- lead_time <= 65.50 | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | | |--- weights: [46.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | |--- no_of_weekend_nights <= 5.00 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | |--- no_of_weekend_nights > 5.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- lead_time > 65.50 | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | |--- lead_time <= 74.50 | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 74.50 | | | | | | | | | | |--- avg_price_per_room <= 88.84 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- avg_price_per_room > 88.84 | | | | | | | | | | | |--- weights: [0.00, 22.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | |--- lead_time <= 66.50 | | | | | | | | | | |--- arrival_date <= 10.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 10.00 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 66.50 | | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | |--- avg_price_per_room > 195.78 | | | | | | |--- arrival_year <= 2017.50 | | | | | | | |--- weights: [0.00, 15.00] class: 1.0 | | | | | | |--- arrival_year > 2017.50 | | | | | | | |--- market_segment_type_Offline <= 0.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- market_segment_type_Offline > 0.50 | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | |--- lead_time > 88.50 | | | | |--- avg_price_per_room <= 93.33 | | | | | |--- lead_time <= 121.50 | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | |--- avg_price_per_room <= 75.38 | | | | | | | | |--- lead_time <= 98.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 98.50 | | | | | | | | | |--- avg_price_per_room <= 58.75 | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 58.75 | | | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | |--- avg_price_per_room > 75.38 | | | | | | | | |--- lead_time <= 120.50 | | | | | | | | | |--- arrival_date <= 4.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_date > 4.50 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- lead_time > 120.50 | | | | | | | | | |--- arrival_date <= 14.00 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 14.00 | | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | |--- arrival_date <= 15.50 | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | |--- arrival_date <= 10.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_date > 10.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_date > 15.50 | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | |--- avg_price_per_room <= 64.88 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- avg_price_per_room > 64.88 | | | | | | | | | | | |--- weights: [42.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | |--- no_of_previous_bookings_not_canceled <= 7.50 | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- no_of_previous_bookings_not_canceled > 7.50 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | |--- lead_time > 121.50 | | | | | | |--- room_type_reserved_Room_Type 2 <= 0.50 | | | | | | | |--- avg_price_per_room <= 64.38 | | | | | | | | |--- avg_price_per_room <= 62.88 | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 62.88 | | | | | | | | | |--- arrival_date <= 13.00 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 13.00 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 64.38 | | | | | | | | |--- lead_time <= 141.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [38.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 141.50 | | | | | | | | | |--- arrival_date <= 11.50 | | | | | | | | | | |--- arrival_date <= 10.50 | | | | | | | | | | | |--- weights: [21.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 10.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_date > 11.50 | | | | | | | | | | |--- weights: [105.00, 0.00] class: 0.0 | | | | | | |--- room_type_reserved_Room_Type 2 > 0.50 | | | | | | | |--- avg_price_per_room <= 77.88 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 77.88 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | |--- avg_price_per_room > 93.33 | | | | | |--- lead_time <= 113.50 | | | | | | |--- arrival_month <= 5.50 | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | |--- room_type_reserved_Room_Type 5 <= 0.50 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- room_type_reserved_Room_Type 5 > 0.50 | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | |--- weights: [8.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 5.50 | | | | | | | |--- arrival_date <= 11.50 | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | |--- lead_time <= 110.50 | | | | | | | | | | |--- avg_price_per_room <= 101.14 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 101.14 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 110.50 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | |--- avg_price_per_room <= 116.75 | | | | | | | | | | |--- lead_time <= 111.50 | | | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 111.50 | | | | | | | | | | | |--- weights: [15.00, 1.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 116.75 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- arrival_date > 11.50 | | | | | | | | |--- avg_price_per_room <= 108.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | | |--- weights: [0.00, 47.00] class: 1.0 | | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 99.14 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- avg_price_per_room > 99.14 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 108.50 | | | | | | | | | |--- arrival_date <= 15.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- weights: [0.00, 21.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | | | | | |--- arrival_date > 15.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | |--- lead_time > 113.50 | | | | | | |--- lead_time <= 133.50 | | | | | | | |--- avg_price_per_room <= 99.14 | | | | | | | | |--- avg_price_per_room <= 98.55 | | | | | | | | | |--- avg_price_per_room <= 94.77 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 94.77 | | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- avg_price_per_room > 98.55 | | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 99.14 | | | | | | | | |--- avg_price_per_room <= 153.26 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 105.20 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- avg_price_per_room > 105.20 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- avg_price_per_room > 153.26 | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | |--- weights: [0.00, 7.00] class: 1.0 | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 133.50 | | | | | | | |--- avg_price_per_room <= 107.05 | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | |--- lead_time <= 140.50 | | | | | | | | | | |--- avg_price_per_room <= 94.75 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 94.75 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | |--- lead_time > 140.50 | | | | | | | | | | |--- no_of_children <= 1.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- no_of_children > 1.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 107.05 | | | | | | | | |--- avg_price_per_room <= 131.00 | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | |--- avg_price_per_room <= 115.81 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | | |--- avg_price_per_room > 115.81 | | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 131.00 | | | | | | | | | |--- lead_time <= 150.00 | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 150.00 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | |--- market_segment_type_Online > 0.50 | | | |--- lead_time <= 13.50 | | | | |--- avg_price_per_room <= 195.85 | | | | | |--- lead_time <= 3.50 | | | | | | |--- arrival_month <= 1.50 | | | | | | | |--- weights: [121.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 1.50 | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | |--- avg_price_per_room <= 77.50 | | | | | | | | | | | |--- weights: [22.00, 0.00] class: 0.0 | | | | | | | | | | |--- avg_price_per_room > 77.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | |--- arrival_date <= 22.00 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- arrival_date > 22.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 107.94 | | | | | | | | | | |--- arrival_date <= 21.50 | | | | | | | | | | | |--- weights: [59.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 21.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- avg_price_per_room > 107.94 | | | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- arrival_month > 5.50 | | | | | | | | |--- avg_price_per_room <= 133.17 | | | | | | | | | |--- no_of_weekend_nights <= 2.50 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- no_of_weekend_nights > 2.50 | | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 133.17 | | | | | | | | | |--- avg_price_per_room <= 133.67 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 133.67 | | | | | | | | | | |--- lead_time <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- lead_time > 2.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | |--- lead_time > 3.50 | | | | | | |--- avg_price_per_room <= 100.25 | | | | | | | |--- avg_price_per_room <= 77.70 | | | | | | | | |--- no_of_weekend_nights <= 5.00 | | | | | | | | | |--- arrival_date <= 1.50 | | | | | | | | | | |--- no_of_week_nights <= 3.00 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_week_nights > 3.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 1.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | |--- no_of_weekend_nights > 5.00 | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 77.70 | | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | | |--- weights: [53.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_month > 1.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- avg_price_per_room <= 79.17 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- avg_price_per_room > 79.17 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [49.00, 0.00] class: 0.0 | | | | | | |--- avg_price_per_room > 100.25 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- lead_time <= 5.50 | | | | | | | | | | | |--- weights: [14.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 5.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 101.15 | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 101.15 | | | | | | | | | | |--- lead_time <= 11.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- lead_time > 11.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [32.00, 0.00] class: 0.0 | | | | |--- avg_price_per_room > 195.85 | | | | | |--- no_of_week_nights <= 1.50 | | | | | | |--- arrival_month <= 10.50 | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- lead_time <= 9.50 | | | | | | | | | | |--- lead_time <= 8.50 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | | |--- lead_time > 8.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 9.50 | | | | | | | | | | |--- weights: [0.00, 7.00] class: 1.0 | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 10.50 | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | |--- no_of_week_nights > 1.50 | | | | | | |--- arrival_month <= 1.50 | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 1.50 | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | |--- weights: [0.00, 44.00] class: 1.0 | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | |--- lead_time <= 3.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- lead_time > 3.00 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | |--- weights: [0.00, 6.00] class: 1.0 | | | |--- lead_time > 13.50 | | | | |--- avg_price_per_room <= 99.88 | | | | | |--- avg_price_per_room <= 60.28 | | | | | | |--- lead_time <= 84.50 | | | | | | | |--- arrival_date <= 1.50 | | | | | | | | |--- avg_price_per_room <= 53.40 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 53.40 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- arrival_date > 1.50 | | | | | | | | |--- avg_price_per_room <= 30.02 | | | | | | | | | |--- weights: [36.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 30.02 | | | | | | | | | |--- avg_price_per_room <= 41.62 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 41.62 | | | | | | | | | | |--- avg_price_per_room <= 54.27 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | | | |--- avg_price_per_room > 54.27 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | |--- lead_time > 84.50 | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | |--- avg_price_per_room <= 59.43 | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | |--- lead_time <= 89.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 89.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 59.43 | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | |--- avg_price_per_room > 60.28 | | | | | | |--- lead_time <= 25.50 | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | |--- lead_time <= 24.50 | | | | | | | | | |--- weights: [58.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 24.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- arrival_month > 1.50 | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | |--- arrival_date <= 12.50 | | | | | | | | | | |--- avg_price_per_room <= 72.44 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 72.44 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | |--- arrival_date > 12.50 | | | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [47.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 25.50 | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | |--- lead_time <= 42.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- lead_time <= 27.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 27.50 | | | | | | | | | | | |--- weights: [32.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | |--- lead_time > 42.50 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | |--- avg_price_per_room <= 71.83 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- avg_price_per_room > 71.83 | | | | | | | | | | | |--- truncated branch of depth 18 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | |--- weights: [0.00, 26.00] class: 1.0 | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- arrival_date <= 9.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 9.00 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 15 | | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- arrival_month <= 2.50 | | | | | | | | | | |--- lead_time <= 54.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- lead_time > 54.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_month > 2.50 | | | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 15 | | | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | |--- avg_price_per_room > 99.88 | | | | | |--- required_car_parking_space <= 0.50 | | | | | | |--- avg_price_per_room <= 194.93 | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- lead_time <= 94.50 | | | | | | | | | | |--- avg_price_per_room <= 101.44 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 101.44 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | |--- lead_time > 94.50 | | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- room_type_reserved_Room_Type 5 <= 0.50 | | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | | |--- truncated branch of depth 24 | | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | |--- room_type_reserved_Room_Type 5 > 0.50 | | | | | | | | | | |--- arrival_date <= 12.50 | | | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 12.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | |--- lead_time <= 35.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- truncated branch of depth 25 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- lead_time <= 26.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- lead_time > 26.50 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | |--- lead_time > 35.50 | | | | | | | | | |--- lead_time <= 149.50 | | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | | |--- truncated branch of depth 28 | | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | | |--- truncated branch of depth 20 | | | | | | | | | |--- lead_time > 149.50 | | | | | | | | | | |--- arrival_date <= 3.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 3.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | |--- avg_price_per_room > 194.93 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- lead_time <= 41.50 | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | |--- lead_time <= 17.00 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 17.00 | | | | | | | | | | | |--- weights: [0.00, 6.00] class: 1.0 | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | |--- weights: [0.00, 118.00] class: 1.0 | | | | | | | | |--- lead_time > 41.50 | | | | | | | | | |--- lead_time <= 44.50 | | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- lead_time > 44.50 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | |--- required_car_parking_space > 0.50 | | | | | | |--- avg_price_per_room <= 195.71 | | | | | | | |--- weights: [73.00, 0.00] class: 0.0 | | | | | | |--- avg_price_per_room > 195.71 | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | |--- no_of_special_requests > 0.50 | | |--- no_of_special_requests <= 1.50 | | | |--- market_segment_type_Online <= 0.50 | | | | |--- lead_time <= 91.50 | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | |--- no_of_weekend_nights <= 2.50 | | | | | | | |--- avg_price_per_room <= 129.50 | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | |--- weights: [999.00, 0.00] class: 0.0 | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | | | | |--- weights: [88.00, 0.00] class: 0.0 | | | | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- avg_price_per_room > 129.50 | | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | | |--- weights: [40.00, 0.00] class: 0.0 | | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | |--- no_of_weekend_nights > 2.50 | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 6.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | |--- weights: [27.00, 0.00] class: 0.0 | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | |--- lead_time <= 42.50 | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | |--- weights: [2.00, 1.00] class: 0.0 | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 42.50 | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | |--- lead_time > 91.50 | | | | | |--- avg_price_per_room <= 180.43 | | | | | | |--- arrival_date <= 13.50 | | | | | | | |--- lead_time <= 109.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- lead_time <= 92.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- lead_time > 92.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 87.05 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 87.05 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- lead_time > 109.50 | | | | | | | | |--- arrival_date <= 6.50 | | | | | | | | | |--- weights: [52.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 6.50 | | | | | | | | | |--- lead_time <= 140.00 | | | | | | | | | | |--- lead_time <= 127.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- lead_time > 127.50 | | | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 140.00 | | | | | | | | | | |--- avg_price_per_room <= 83.72 | | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 83.72 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | |--- arrival_date > 13.50 | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | |--- lead_time <= 108.00 | | | | | | | | | | |--- lead_time <= 101.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 101.00 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- lead_time > 108.00 | | | | | | | | | | |--- arrival_date <= 18.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 18.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | |--- lead_time <= 137.50 | | | | | | | | | | |--- weights: [91.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 137.50 | | | | | | | | | | |--- lead_time <= 139.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- lead_time > 139.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | |--- avg_price_per_room > 180.43 | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | |--- market_segment_type_Online > 0.50 | | | | |--- lead_time <= 6.50 | | | | | |--- avg_price_per_room <= 157.64 | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | |--- lead_time <= 4.50 | | | | | | | | |--- room_type_reserved_Room_Type 2 <= 0.50 | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | | |--- weights: [108.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | |--- no_of_week_nights <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 4.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- room_type_reserved_Room_Type 2 > 0.50 | | | | | | | | | |--- no_of_children <= 1.00 | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_children > 1.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- lead_time > 4.50 | | | | | | | | |--- arrival_date <= 4.50 | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- arrival_date > 4.50 | | | | | | | | | |--- avg_price_per_room <= 134.92 | | | | | | | | | | |--- arrival_date <= 7.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- arrival_date > 7.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | |--- avg_price_per_room > 134.92 | | | | | | | | | | |--- avg_price_per_room <= 135.25 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 135.25 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | |--- avg_price_per_room <= 99.33 | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | |--- avg_price_per_room > 99.33 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | |--- avg_price_per_room > 157.64 | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | |--- arrival_date <= 30.50 | | | | | | | | |--- lead_time <= 4.50 | | | | | | | | | |--- avg_price_per_room <= 158.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 158.50 | | | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- lead_time > 4.50 | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | |--- arrival_date <= 14.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_date > 14.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- arrival_date > 30.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 10.50 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | |--- lead_time > 6.50 | | | | | |--- avg_price_per_room <= 118.62 | | | | | | |--- no_of_weekend_nights <= 2.50 | | | | | | | |--- lead_time <= 68.50 | | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | | |--- weights: [256.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_month > 1.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 22 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- truncated branch of depth 18 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [198.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 68.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | |--- arrival_date <= 26.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 26.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- arrival_month <= 3.50 | | | | | | | | | | |--- avg_price_per_room <= 71.19 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- avg_price_per_room > 71.19 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | |--- arrival_month > 3.50 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- truncated branch of depth 15 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | |--- no_of_weekend_nights > 2.50 | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | |--- arrival_date <= 10.50 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- arrival_date > 10.50 | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 1.50 | | | | | | | | |--- lead_time <= 108.50 | | | | | | | | | |--- arrival_date <= 5.50 | | | | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- arrival_date > 5.50 | | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | | |--- weights: [0.00, 19.00] class: 1.0 | | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- lead_time > 108.50 | | | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | |--- avg_price_per_room > 118.62 | | | | | | |--- required_car_parking_space <= 0.50 | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | |--- arrival_month <= 8.50 | | | | | | | | | |--- lead_time <= 142.50 | | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | | |--- truncated branch of depth 18 | | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | |--- lead_time > 142.50 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_month > 8.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | | |--- truncated branch of depth 22 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- lead_time <= 102.00 | | | | | | | | | | | |--- weights: [77.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 102.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | |--- lead_time <= 150.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- avg_price_per_room <= 154.90 | | | | | | | | | | | |--- truncated branch of depth 23 | | | | | | | | | | |--- avg_price_per_room > 154.90 | | | | | | | | | | | |--- truncated branch of depth 22 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 124.70 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- avg_price_per_room > 124.70 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | |--- lead_time > 150.50 | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | |--- required_car_parking_space > 0.50 | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | |--- lead_time <= 150.00 | | | | | | | | | |--- weights: [126.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 150.00 | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | |--- no_of_special_requests > 1.50 | | | |--- lead_time <= 89.50 | | | | |--- no_of_week_nights <= 3.50 | | | | | |--- weights: [3272.00, 0.00] class: 0.0 | | | | |--- no_of_week_nights > 3.50 | | | | | |--- no_of_weekend_nights <= 4.50 | | | | | | |--- no_of_special_requests <= 2.50 | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | |--- room_type_reserved_Room_Type 5 <= 0.50 | | | | | | | | | |--- arrival_date <= 30.50 | | | | | | | | | | |--- avg_price_per_room <= 125.90 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | | |--- avg_price_per_room > 125.90 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | |--- arrival_date > 30.50 | | | | | | | | | | |--- lead_time <= 11.00 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 11.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- room_type_reserved_Room_Type 5 > 0.50 | | | | | | | | | |--- lead_time <= 37.50 | | | | | | | | | | |--- weights: [8.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 37.50 | | | | | | | | | | |--- arrival_date <= 22.00 | | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 22.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | |--- arrival_date <= 5.50 | | | | | | | | | |--- weights: [12.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 5.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- lead_time <= 37.00 | | | | | | | | | | | |--- weights: [12.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 37.00 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 100.84 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | | | |--- avg_price_per_room > 100.84 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | |--- no_of_special_requests > 2.50 | | | | | | | |--- weights: [97.00, 0.00] class: 0.0 | | | | | |--- no_of_weekend_nights > 4.50 | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | |--- lead_time > 89.50 | | | | |--- no_of_special_requests <= 2.50 | | | | | |--- avg_price_per_room <= 192.29 | | | | | | |--- arrival_month <= 4.50 | | | | | | | |--- avg_price_per_room <= 71.13 | | | | | | | | |--- weights: [13.00, 0.00] class: 0.0 | | | | | | | |--- avg_price_per_room > 71.13 | | | | | | | | |--- avg_price_per_room <= 73.04 | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 73.04 | | | | | | | | | |--- lead_time <= 123.50 | | | | | | | | | | |--- avg_price_per_room <= 98.95 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- avg_price_per_room > 98.95 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- lead_time > 123.50 | | | | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | |--- arrival_month > 4.50 | | | | | | | |--- arrival_month <= 8.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | |--- lead_time <= 98.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- lead_time > 98.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- lead_time <= 150.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | |--- lead_time > 150.50 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- arrival_month > 8.50 | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- lead_time <= 142.00 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | | |--- lead_time > 142.00 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- avg_price_per_room <= 79.95 | | | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 79.95 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- lead_time <= 124.50 | | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 124.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | |--- avg_price_per_room > 192.29 | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | |--- lead_time <= 127.50 | | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | | |--- avg_price_per_room <= 195.88 | | | | | | | | | | |--- arrival_date <= 24.50 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 24.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 195.88 | | | | | | | | | | |--- arrival_date <= 8.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 8.50 | | | | | | | | | | | |--- weights: [0.00, 11.00] class: 1.0 | | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 127.50 | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | |--- no_of_special_requests > 2.50 | | | | | |--- weights: [198.00, 0.00] class: 0.0 |--- lead_time > 151.50 | |--- avg_price_per_room <= 100.04 | | |--- no_of_special_requests <= 0.50 | | | |--- market_segment_type_Online <= 0.50 | | | | |--- no_of_adults <= 1.50 | | | | | |--- lead_time <= 163.50 | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 6.50 | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | |--- no_of_week_nights <= 4.00 | | | | | | | | |--- weights: [0.00, 20.00] class: 1.0 | | | | | | | |--- no_of_week_nights > 4.00 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | |--- lead_time > 163.50 | | | | | | |--- lead_time <= 323.25 | | | | | | | |--- lead_time <= 175.50 | | | | | | | | |--- arrival_date <= 23.00 | | | | | | | | | |--- avg_price_per_room <= 79.10 | | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- avg_price_per_room > 79.10 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- arrival_date > 23.00 | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | |--- lead_time > 175.50 | | | | | | | | |--- avg_price_per_room <= 98.00 | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | |--- arrival_date <= 9.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 9.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | |--- avg_price_per_room <= 57.29 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- avg_price_per_room > 57.29 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | |--- avg_price_per_room > 98.00 | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | |--- lead_time > 323.25 | | | | | | | |--- arrival_date <= 14.50 | | | | | | | | |--- no_of_week_nights <= 4.50 | | | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | |--- arrival_month > 6.50 | | | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | | | |--- weights: [20.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_week_nights > 4.50 | | | | | | | | | |--- avg_price_per_room <= 88.33 | | | | | | | | | | |--- weights: [0.00, 7.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 88.33 | | | | | | | | | | |--- weights: [2.00, 1.00] class: 0.0 | | | | | | | |--- arrival_date > 14.50 | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 88.00 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 88.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | |--- no_of_adults > 1.50 | | | | | |--- avg_price_per_room <= 84.42 | | | | | | |--- lead_time <= 273.00 | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | |--- lead_time <= 172.50 | | | | | | | | | |--- arrival_date <= 6.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 6.00 | | | | | | | | | | |--- lead_time <= 161.00 | | | | | | | | | | | |--- weights: [29.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 161.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- lead_time > 172.50 | | | | | | | | | |--- avg_price_per_room <= 77.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 77.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | |--- no_of_previous_cancellations <= 6.50 | | | | | | | | | |--- lead_time <= 174.50 | | | | | | | | | | |--- lead_time <= 173.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- lead_time > 173.50 | | | | | | | | | | | |--- weights: [0.00, 11.00] class: 1.0 | | | | | | | | | |--- lead_time > 174.50 | | | | | | | | | | |--- avg_price_per_room <= 29.07 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 29.07 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | |--- no_of_previous_cancellations > 6.50 | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | |--- lead_time > 273.00 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- avg_price_per_room <= 80.42 | | | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- avg_price_per_room > 80.42 | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [29.00, 0.00] class: 0.0 | | | | | |--- avg_price_per_room > 84.42 | | | | | | |--- lead_time <= 196.00 | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- lead_time <= 183.50 | | | | | | | | | | |--- weights: [0.00, 33.00] class: 1.0 | | | | | | | | | |--- lead_time > 183.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 94.53 | | | | | | | | | | |--- no_of_week_nights <= 5.00 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- no_of_week_nights > 5.00 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 94.53 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- arrival_month > 6.50 | | | | | | | | |--- lead_time <= 155.50 | | | | | | | | | |--- avg_price_per_room <= 97.60 | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 97.60 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 155.50 | | | | | | | | | |--- weights: [21.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 196.00 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | |--- market_segment_type_Online > 0.50 | | | | |--- avg_price_per_room <= 17.98 | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | |--- arrival_date <= 11.00 | | | | | | | |--- lead_time <= 249.75 | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 249.75 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | |--- arrival_date > 11.00 | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | |--- arrival_date <= 8.50 | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | | |--- arrival_date > 8.50 | | | | | | | |--- weights: [8.00, 0.00] class: 0.0 | | | | |--- avg_price_per_room > 17.98 | | | | | |--- no_of_adults <= 2.50 | | | | | | |--- arrival_month <= 11.50 | | | | | | | |--- weights: [0.00, 865.00] class: 1.0 | | | | | | |--- arrival_month > 11.50 | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | |--- avg_price_per_room <= 73.77 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- avg_price_per_room > 73.77 | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | |--- avg_price_per_room <= 76.87 | | | | | | | | | | |--- weights: [0.00, 10.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 76.87 | | | | | | | | | | |--- lead_time <= 270.00 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 270.00 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | |--- weights: [0.00, 56.00] class: 1.0 | | | | | |--- no_of_adults > 2.50 | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | |--- no_of_special_requests > 0.50 | | | |--- no_of_weekend_nights <= 0.50 | | | | |--- lead_time <= 180.50 | | | | | |--- arrival_date <= 30.50 | | | | | | |--- arrival_date <= 22.00 | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | |--- lead_time <= 156.50 | | | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_month > 6.50 | | | | | | | | | | |--- arrival_date <= 12.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 12.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- lead_time > 156.50 | | | | | | | | | |--- weights: [47.00, 0.00] class: 0.0 | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | |--- arrival_date <= 6.00 | | | | | | | | | |--- avg_price_per_room <= 80.55 | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 80.55 | | | | | | | | | | |--- avg_price_per_room <= 89.70 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 89.70 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 6.00 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- weights: [16.00, 0.00] class: 0.0 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | |--- arrival_date > 22.00 | | | | | | | |--- arrival_month <= 2.00 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- arrival_month > 2.00 | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- lead_time <= 161.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 161.00 | | | | | | | | | | | |--- weights: [15.00, 0.00] class: 0.0 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 98.01 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- avg_price_per_room > 98.01 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | |--- arrival_date > 30.50 | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | |--- lead_time > 180.50 | | | | | |--- no_of_special_requests <= 2.50 | | | | | | |--- market_segment_type_Online <= 0.50 | | | | | | | |--- avg_price_per_room <= 93.22 | | | | | | | | |--- arrival_date <= 7.50 | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- arrival_date > 7.50 | | | | | | | | | |--- lead_time <= 190.00 | | | | | | | | | | |--- arrival_date <= 25.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 25.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 190.00 | | | | | | | | | | |--- lead_time <= 317.25 | | | | | | | | | | | |--- weights: [23.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 317.25 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- avg_price_per_room > 93.22 | | | | | | | | |--- arrival_date <= 16.00 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 16.00 | | | | | | | | | |--- arrival_date <= 22.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 22.50 | | | | | | | | | | |--- weights: [1.00, 6.00] class: 1.0 | | | | | | |--- market_segment_type_Online > 0.50 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- avg_price_per_room <= 36.16 | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 36.16 | | | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | | | |--- arrival_date <= 11.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 11.50 | | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- arrival_month > 1.50 | | | | | | | | | | |--- weights: [0.00, 249.00] class: 1.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- lead_time <= 300.50 | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | |--- lead_time <= 221.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 221.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- lead_time > 300.50 | | | | | | | | | |--- weights: [0.00, 6.00] class: 1.0 | | | | | |--- no_of_special_requests > 2.50 | | | | | | |--- weights: [27.00, 0.00] class: 0.0 | | | |--- no_of_weekend_nights > 0.50 | | | | |--- market_segment_type_Online <= 0.50 | | | | | |--- lead_time <= 315.00 | | | | | | |--- no_of_special_requests <= 1.50 | | | | | | | |--- lead_time <= 157.50 | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | |--- avg_price_per_room <= 76.17 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 76.17 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 157.50 | | | | | | | | |--- weights: [160.00, 0.00] class: 0.0 | | | | | | |--- no_of_special_requests > 1.50 | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | |--- arrival_date <= 22.00 | | | | | | | | | |--- lead_time <= 215.50 | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 215.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- arrival_date > 22.00 | | | | | | | | | |--- arrival_date <= 27.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 27.00 | | | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | |--- lead_time > 315.00 | | | | | | |--- arrival_date <= 5.50 | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | |--- arrival_date > 5.50 | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- arrival_month > 5.50 | | | | | | | | |--- avg_price_per_room <= 90.33 | | | | | | | | | |--- arrival_date <= 13.50 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 13.50 | | | | | | | | | | |--- no_of_special_requests <= 2.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_special_requests > 2.00 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 90.33 | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | |--- market_segment_type_Online > 0.50 | | | | | |--- no_of_special_requests <= 2.50 | | | | | | |--- arrival_year <= 2018.50 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | | |--- avg_price_per_room <= 75.87 | | | | | | | | | | |--- lead_time <= 245.50 | | | | | | | | | | | |--- weights: [50.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 245.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- avg_price_per_room > 75.87 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- avg_price_per_room <= 55.92 | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 55.92 | | | | | | | | | |--- lead_time <= 302.00 | | | | | | | | | | |--- arrival_date <= 29.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- arrival_date > 29.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- lead_time > 302.00 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | |--- arrival_year > 2018.50 | | | | | | | |--- avg_price_per_room <= 74.71 | | | | | | | | |--- avg_price_per_room <= 66.30 | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 66.30 | | | | | | | | | |--- lead_time <= 161.00 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 161.00 | | | | | | | | | | |--- arrival_month <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_month > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- avg_price_per_room > 74.71 | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | |--- arrival_date <= 25.50 | | | | | | | | | | |--- avg_price_per_room <= 99.10 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- avg_price_per_room > 99.10 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 25.50 | | | | | | | | | | |--- arrival_date <= 27.50 | | | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 27.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | |--- lead_time <= 301.50 | | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | |--- lead_time > 301.50 | | | | | | | | | | |--- avg_price_per_room <= 95.72 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- avg_price_per_room > 95.72 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | |--- no_of_special_requests > 2.50 | | | | | | |--- weights: [51.00, 0.00] class: 0.0 | |--- avg_price_per_room > 100.04 | | |--- no_of_special_requests <= 2.50 | | | |--- arrival_month <= 11.50 | | | | |--- arrival_month <= 1.50 | | | | | |--- no_of_special_requests <= 0.50 | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | |--- no_of_special_requests > 0.50 | | | | | | |--- arrival_date <= 17.00 | | | | | | | |--- required_car_parking_space <= 0.50 | | | | | | | | |--- avg_price_per_room <= 105.72 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 105.72 | | | | | | | | | |--- weights: [0.00, 12.00] class: 1.0 | | | | | | | |--- required_car_parking_space > 0.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- arrival_date > 17.00 | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | |--- arrival_month > 1.50 | | | | | |--- weights: [0.00, 4532.00] class: 1.0 | | | |--- arrival_month > 11.50 | | | | |--- no_of_special_requests <= 0.50 | | | | | |--- weights: [55.00, 0.00] class: 0.0 | | | | |--- no_of_special_requests > 0.50 | | | | | |--- arrival_date <= 24.00 | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | |--- arrival_date > 24.00 | | | | | | |--- lead_time <= 153.50 | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 153.50 | | | | | | | |--- avg_price_per_room <= 121.55 | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 121.55 | | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | |--- no_of_special_requests > 2.50 | | | |--- weights: [154.00, 0.00] class: 0.0
# importance of features in the tree building ( The importance of a feature is computed as the
# (normalized) total reduction of the criterion brought by that feature. It is also known as the Gini importance )
print(
pd.DataFrame(
model.feature_importances_, columns=["Imp"], index=X_train.columns
).sort_values(by="Imp", ascending=False)
)
Imp lead_time 0.373230 avg_price_per_room 0.166861 arrival_date 0.084099 no_of_special_requests 0.077874 market_segment_type_Online 0.074284 arrival_month 0.057720 no_of_week_nights 0.044924 no_of_weekend_nights 0.035578 no_of_adults 0.024221 arrival_year 0.016036 type_of_meal_plan_Not Selected 0.008660 room_type_reserved_Room_Type 4 0.008443 no_of_children 0.005696 required_car_parking_space 0.005643 market_segment_type_Corporate 0.004634 type_of_meal_plan_Meal Plan 2 0.004207 room_type_reserved_Room_Type 5 0.002542 room_type_reserved_Room_Type 2 0.001740 room_type_reserved_Room_Type 6 0.000993 market_segment_type_Offline 0.000678 no_of_previous_bookings_not_canceled 0.000607 repeated_guest 0.000570 room_type_reserved_Room_Type 7 0.000401 no_of_previous_cancellations 0.000326 market_segment_type_Complementary 0.000032 type_of_meal_plan_Meal Plan 3 0.000000 room_type_reserved_Room_Type 3 0.000000 const 0.000000
importances = model.feature_importances_
indices = np.argsort(importances)
plt.figure(figsize=(12, 12))
plt.title("Feature Importances")
plt.barh(range(len(indices)), importances[indices], color="violet", align="center")
plt.yticks(range(len(indices)), [feature_names[i] for i in indices])
plt.xlabel("Relative Importance")
plt.show()
According to the model lead time is the most important parameter to predict cancellation
# Choose the type of classifier.
estimator = DecisionTreeClassifier(random_state=1, class_weight={0:0.4,1:0.6})
# Grid of parameters to choose from
parameters = {
"max_depth": [np.arange(2,50,5), None],
"criterion": ["entropy", "gini"],
"splitter": ["best", "random"],
"max_leaf_nodes" : [1,5,10,15],
"max_features" : [10,20],
"min_impurity_decrease": [0.00001, 0.0001, 0.001, 0.01, 0.1],
}
# Type of scoring used to compare parameter combinations
scorer = make_scorer(recall_score)
# Run the grid search
grid_obj = GridSearchCV(estimator, parameters, scoring=scorer, cv=5)
grid_obj = grid_obj.fit(X_train, y_train.astype('float'))
# Set the clf to the best combination of parameters
estimator = grid_obj.best_estimator_
# Fit the best algorithm to the data.
estimator.fit(X_train, y_train.astype('float'))
DecisionTreeClassifier(class_weight={0: 0.4, 1: 0.6}, criterion='entropy',
max_features=20, max_leaf_nodes=10,
min_impurity_decrease=0.01, random_state=1,
splitter='random')
confusion_matrix_sklearn(estimator, X_train, y_train.astype('float'))
y_pred_train3 = model.predict(X_test)
decision_tree_tune_perf_train = recall_score(y_test.astype('float'), y_pred_train3.astype('float'))
print(f'the recall score i:', decision_tree_tune_perf_train)
the recall score i: 0.8028913415202861
confusion_matrix_sklearn(estimator, X_test, y_test.astype('float'))
y_pred_test3 = model.predict(X_test)
decision_tree_tune_perf_test = recall_score(y_test.astype('float'), y_pred_test3.astype('float'))
print(f'the recall score is :', decision_tree_tune_perf_test)
the recall score is : 0.8028913415202861
plt.figure(figsize=(15, 10))
out = tree.plot_tree(
estimator,
feature_names=feature_names,
filled=True,
fontsize=9,
node_ids=False,
class_names=None,
)
for o in out:
arrow = o.arrow_patch
if arrow is not None:
arrow.set_edgecolor("black")
arrow.set_linewidth(1)
plt.show()
# Text report showing the rules of a decision tree -
print(tree.export_text(model, feature_names=feature_names, show_weights=True))
|--- lead_time <= 151.50 | |--- no_of_special_requests <= 0.50 | | |--- market_segment_type_Online <= 0.50 | | | |--- lead_time <= 88.50 | | | | |--- arrival_month <= 6.50 | | | | | |--- lead_time <= 36.50 | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | |--- arrival_date <= 21.50 | | | | | | | | |--- avg_price_per_room <= 195.12 | | | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | |--- avg_price_per_room > 195.12 | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- arrival_date > 21.50 | | | | | | | | |--- avg_price_per_room <= 62.45 | | | | | | | | | |--- avg_price_per_room <= 59.75 | | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- avg_price_per_room > 59.75 | | | | | | | | | | |--- weights: [0.00, 37.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 62.45 | | | | | | | | | |--- avg_price_per_room <= 97.50 | | | | | | | | | | |--- lead_time <= 34.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- lead_time > 34.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- avg_price_per_room > 97.50 | | | | | | | | | | |--- lead_time <= 19.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- lead_time > 19.50 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | |--- arrival_date <= 13.50 | | | | | | | | |--- weights: [0.00, 10.00] class: 1.0 | | | | | | | |--- arrival_date > 13.50 | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | |--- arrival_date <= 15.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 15.50 | | | | | | | | | | |--- arrival_month <= 3.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_month > 3.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | |--- lead_time > 36.50 | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | |--- weights: [481.00, 0.00] class: 0.0 | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | |--- arrival_date <= 14.00 | | | | | | | | | | |--- avg_price_per_room <= 78.25 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 78.25 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_date > 14.00 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [13.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | |--- arrival_date <= 16.50 | | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- arrival_date > 16.50 | | | | | | | | | | |--- arrival_date <= 25.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- arrival_date > 25.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | |--- avg_price_per_room <= 85.25 | | | | | | | | |--- avg_price_per_room <= 72.67 | | | | | | | | | |--- no_of_previous_bookings_not_canceled <= 9.50 | | | | | | | | | | |--- weights: [15.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_previous_bookings_not_canceled > 9.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 72.67 | | | | | | | | | |--- weights: [0.00, 89.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 85.25 | | | | | | | | |--- avg_price_per_room <= 132.70 | | | | | | | | | |--- lead_time <= 38.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- lead_time > 38.50 | | | | | | | | | | |--- arrival_date <= 29.00 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_date > 29.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 132.70 | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | |--- arrival_month > 6.50 | | | | | |--- avg_price_per_room <= 195.78 | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | |--- market_segment_type_Offline <= 0.50 | | | | | | | | |--- arrival_date <= 29.50 | | | | | | | | | |--- lead_time <= 86.50 | | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | | |--- weights: [87.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 86.50 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 29.50 | | | | | | | | | |--- avg_price_per_room <= 88.50 | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 88.50 | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | |--- market_segment_type_Offline > 0.50 | | | | | | | | |--- weights: [1116.00, 0.00] class: 0.0 | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | |--- lead_time <= 65.50 | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | | |--- weights: [46.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | |--- no_of_weekend_nights <= 5.00 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | |--- no_of_weekend_nights > 5.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- lead_time > 65.50 | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | |--- lead_time <= 74.50 | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 74.50 | | | | | | | | | | |--- avg_price_per_room <= 88.84 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- avg_price_per_room > 88.84 | | | | | | | | | | | |--- weights: [0.00, 22.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | |--- lead_time <= 66.50 | | | | | | | | | | |--- arrival_date <= 10.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 10.00 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 66.50 | | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | |--- avg_price_per_room > 195.78 | | | | | | |--- arrival_year <= 2017.50 | | | | | | | |--- weights: [0.00, 15.00] class: 1.0 | | | | | | |--- arrival_year > 2017.50 | | | | | | | |--- market_segment_type_Offline <= 0.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- market_segment_type_Offline > 0.50 | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | |--- lead_time > 88.50 | | | | |--- avg_price_per_room <= 93.33 | | | | | |--- lead_time <= 121.50 | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | |--- avg_price_per_room <= 75.38 | | | | | | | | |--- lead_time <= 98.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 98.50 | | | | | | | | | |--- avg_price_per_room <= 58.75 | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 58.75 | | | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | |--- avg_price_per_room > 75.38 | | | | | | | | |--- lead_time <= 120.50 | | | | | | | | | |--- arrival_date <= 4.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_date > 4.50 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- lead_time > 120.50 | | | | | | | | | |--- arrival_date <= 14.00 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 14.00 | | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | |--- arrival_date <= 15.50 | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | |--- arrival_date <= 10.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_date > 10.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_date > 15.50 | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | |--- avg_price_per_room <= 64.88 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- avg_price_per_room > 64.88 | | | | | | | | | | | |--- weights: [42.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | |--- no_of_previous_bookings_not_canceled <= 7.50 | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- no_of_previous_bookings_not_canceled > 7.50 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | |--- lead_time > 121.50 | | | | | | |--- room_type_reserved_Room_Type 2 <= 0.50 | | | | | | | |--- avg_price_per_room <= 64.38 | | | | | | | | |--- avg_price_per_room <= 62.88 | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 62.88 | | | | | | | | | |--- arrival_date <= 13.00 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 13.00 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 64.38 | | | | | | | | |--- lead_time <= 141.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [38.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 141.50 | | | | | | | | | |--- arrival_date <= 11.50 | | | | | | | | | | |--- arrival_date <= 10.50 | | | | | | | | | | | |--- weights: [21.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 10.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_date > 11.50 | | | | | | | | | | |--- weights: [105.00, 0.00] class: 0.0 | | | | | | |--- room_type_reserved_Room_Type 2 > 0.50 | | | | | | | |--- avg_price_per_room <= 77.88 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 77.88 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | |--- avg_price_per_room > 93.33 | | | | | |--- lead_time <= 113.50 | | | | | | |--- arrival_month <= 5.50 | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | |--- room_type_reserved_Room_Type 5 <= 0.50 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- room_type_reserved_Room_Type 5 > 0.50 | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | |--- weights: [8.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 5.50 | | | | | | | |--- arrival_date <= 11.50 | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | |--- lead_time <= 110.50 | | | | | | | | | | |--- avg_price_per_room <= 101.14 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 101.14 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 110.50 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | |--- avg_price_per_room <= 116.75 | | | | | | | | | | |--- lead_time <= 111.50 | | | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 111.50 | | | | | | | | | | | |--- weights: [15.00, 1.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 116.75 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- arrival_date > 11.50 | | | | | | | | |--- avg_price_per_room <= 108.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | | |--- weights: [0.00, 47.00] class: 1.0 | | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 99.14 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- avg_price_per_room > 99.14 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 108.50 | | | | | | | | | |--- arrival_date <= 15.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- weights: [0.00, 21.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | | | | | |--- arrival_date > 15.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | |--- lead_time > 113.50 | | | | | | |--- lead_time <= 133.50 | | | | | | | |--- avg_price_per_room <= 99.14 | | | | | | | | |--- avg_price_per_room <= 98.55 | | | | | | | | | |--- avg_price_per_room <= 94.77 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 94.77 | | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- avg_price_per_room > 98.55 | | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 99.14 | | | | | | | | |--- avg_price_per_room <= 153.26 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 105.20 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- avg_price_per_room > 105.20 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- avg_price_per_room > 153.26 | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | |--- weights: [0.00, 7.00] class: 1.0 | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 133.50 | | | | | | | |--- avg_price_per_room <= 107.05 | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | |--- lead_time <= 140.50 | | | | | | | | | | |--- avg_price_per_room <= 94.75 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 94.75 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | |--- lead_time > 140.50 | | | | | | | | | | |--- no_of_children <= 1.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- no_of_children > 1.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 107.05 | | | | | | | | |--- avg_price_per_room <= 131.00 | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | |--- avg_price_per_room <= 115.81 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | | |--- avg_price_per_room > 115.81 | | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 131.00 | | | | | | | | | |--- lead_time <= 150.00 | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 150.00 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | |--- market_segment_type_Online > 0.50 | | | |--- lead_time <= 13.50 | | | | |--- avg_price_per_room <= 195.85 | | | | | |--- lead_time <= 3.50 | | | | | | |--- arrival_month <= 1.50 | | | | | | | |--- weights: [121.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 1.50 | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | |--- avg_price_per_room <= 77.50 | | | | | | | | | | | |--- weights: [22.00, 0.00] class: 0.0 | | | | | | | | | | |--- avg_price_per_room > 77.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | |--- arrival_date <= 22.00 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- arrival_date > 22.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 107.94 | | | | | | | | | | |--- arrival_date <= 21.50 | | | | | | | | | | | |--- weights: [59.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 21.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- avg_price_per_room > 107.94 | | | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- arrival_month > 5.50 | | | | | | | | |--- avg_price_per_room <= 133.17 | | | | | | | | | |--- no_of_weekend_nights <= 2.50 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- no_of_weekend_nights > 2.50 | | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 133.17 | | | | | | | | | |--- avg_price_per_room <= 133.67 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 133.67 | | | | | | | | | | |--- lead_time <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- lead_time > 2.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | |--- lead_time > 3.50 | | | | | | |--- avg_price_per_room <= 100.25 | | | | | | | |--- avg_price_per_room <= 77.70 | | | | | | | | |--- no_of_weekend_nights <= 5.00 | | | | | | | | | |--- arrival_date <= 1.50 | | | | | | | | | | |--- no_of_week_nights <= 3.00 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_week_nights > 3.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 1.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | |--- no_of_weekend_nights > 5.00 | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 77.70 | | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | | |--- weights: [53.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_month > 1.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- avg_price_per_room <= 79.17 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- avg_price_per_room > 79.17 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [49.00, 0.00] class: 0.0 | | | | | | |--- avg_price_per_room > 100.25 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- lead_time <= 5.50 | | | | | | | | | | | |--- weights: [14.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 5.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 101.15 | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 101.15 | | | | | | | | | | |--- lead_time <= 11.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- lead_time > 11.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [32.00, 0.00] class: 0.0 | | | | |--- avg_price_per_room > 195.85 | | | | | |--- no_of_week_nights <= 1.50 | | | | | | |--- arrival_month <= 10.50 | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- lead_time <= 9.50 | | | | | | | | | | |--- lead_time <= 8.50 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | | |--- lead_time > 8.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 9.50 | | | | | | | | | | |--- weights: [0.00, 7.00] class: 1.0 | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 10.50 | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | |--- no_of_week_nights > 1.50 | | | | | | |--- arrival_month <= 1.50 | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- arrival_month > 1.50 | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | |--- weights: [0.00, 44.00] class: 1.0 | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | |--- lead_time <= 3.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- lead_time > 3.00 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | |--- weights: [0.00, 6.00] class: 1.0 | | | |--- lead_time > 13.50 | | | | |--- avg_price_per_room <= 99.88 | | | | | |--- avg_price_per_room <= 60.28 | | | | | | |--- lead_time <= 84.50 | | | | | | | |--- arrival_date <= 1.50 | | | | | | | | |--- avg_price_per_room <= 53.40 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 53.40 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- arrival_date > 1.50 | | | | | | | | |--- avg_price_per_room <= 30.02 | | | | | | | | | |--- weights: [36.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 30.02 | | | | | | | | | |--- avg_price_per_room <= 41.62 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 41.62 | | | | | | | | | | |--- avg_price_per_room <= 54.27 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | | | |--- avg_price_per_room > 54.27 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | |--- lead_time > 84.50 | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | |--- avg_price_per_room <= 59.43 | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | |--- lead_time <= 89.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 89.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 59.43 | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | |--- avg_price_per_room > 60.28 | | | | | | |--- lead_time <= 25.50 | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | |--- lead_time <= 24.50 | | | | | | | | | |--- weights: [58.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 24.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- arrival_month > 1.50 | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | |--- arrival_date <= 12.50 | | | | | | | | | | |--- avg_price_per_room <= 72.44 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- avg_price_per_room > 72.44 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | |--- arrival_date > 12.50 | | | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [47.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 25.50 | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | |--- lead_time <= 42.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- lead_time <= 27.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 27.50 | | | | | | | | | | | |--- weights: [32.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | |--- lead_time > 42.50 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | |--- avg_price_per_room <= 71.83 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | | |--- avg_price_per_room > 71.83 | | | | | | | | | | | |--- truncated branch of depth 18 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | |--- weights: [0.00, 26.00] class: 1.0 | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- arrival_date <= 9.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 9.00 | | | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 15 | | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- arrival_month <= 2.50 | | | | | | | | | | |--- lead_time <= 54.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- lead_time > 54.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_month > 2.50 | | | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 15 | | | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | |--- avg_price_per_room > 99.88 | | | | | |--- required_car_parking_space <= 0.50 | | | | | | |--- avg_price_per_room <= 194.93 | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- lead_time <= 94.50 | | | | | | | | | | |--- avg_price_per_room <= 101.44 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 101.44 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | |--- lead_time > 94.50 | | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- room_type_reserved_Room_Type 5 <= 0.50 | | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | | |--- truncated branch of depth 24 | | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | | | |--- room_type_reserved_Room_Type 5 > 0.50 | | | | | | | | | | |--- arrival_date <= 12.50 | | | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 12.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | |--- lead_time <= 35.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- truncated branch of depth 25 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- lead_time <= 26.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- lead_time > 26.50 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | |--- lead_time > 35.50 | | | | | | | | | |--- lead_time <= 149.50 | | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | | |--- truncated branch of depth 28 | | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | | |--- truncated branch of depth 20 | | | | | | | | | |--- lead_time > 149.50 | | | | | | | | | | |--- arrival_date <= 3.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 3.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | |--- avg_price_per_room > 194.93 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- lead_time <= 41.50 | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | |--- lead_time <= 17.00 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 17.00 | | | | | | | | | | | |--- weights: [0.00, 6.00] class: 1.0 | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | |--- weights: [0.00, 118.00] class: 1.0 | | | | | | | | |--- lead_time > 41.50 | | | | | | | | | |--- lead_time <= 44.50 | | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- lead_time > 44.50 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 10 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | |--- required_car_parking_space > 0.50 | | | | | | |--- avg_price_per_room <= 195.71 | | | | | | | |--- weights: [73.00, 0.00] class: 0.0 | | | | | | |--- avg_price_per_room > 195.71 | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | |--- no_of_special_requests > 0.50 | | |--- no_of_special_requests <= 1.50 | | | |--- market_segment_type_Online <= 0.50 | | | | |--- lead_time <= 91.50 | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | |--- no_of_weekend_nights <= 2.50 | | | | | | | |--- avg_price_per_room <= 129.50 | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | |--- weights: [999.00, 0.00] class: 0.0 | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | | | | |--- weights: [88.00, 0.00] class: 0.0 | | | | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- avg_price_per_room > 129.50 | | | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | | | |--- weights: [40.00, 0.00] class: 0.0 | | | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | |--- no_of_weekend_nights > 2.50 | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 6.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | |--- market_segment_type_Corporate <= 0.50 | | | | | | | |--- weights: [27.00, 0.00] class: 0.0 | | | | | | |--- market_segment_type_Corporate > 0.50 | | | | | | | |--- lead_time <= 42.50 | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | |--- weights: [2.00, 1.00] class: 0.0 | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 42.50 | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | |--- lead_time > 91.50 | | | | | |--- avg_price_per_room <= 180.43 | | | | | | |--- arrival_date <= 13.50 | | | | | | | |--- lead_time <= 109.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | |--- lead_time <= 92.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- lead_time > 92.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 87.05 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 87.05 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- lead_time > 109.50 | | | | | | | | |--- arrival_date <= 6.50 | | | | | | | | | |--- weights: [52.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 6.50 | | | | | | | | | |--- lead_time <= 140.00 | | | | | | | | | | |--- lead_time <= 127.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- lead_time > 127.50 | | | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 140.00 | | | | | | | | | | |--- avg_price_per_room <= 83.72 | | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 83.72 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | |--- arrival_date > 13.50 | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | |--- lead_time <= 108.00 | | | | | | | | | | |--- lead_time <= 101.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 101.00 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- lead_time > 108.00 | | | | | | | | | | |--- arrival_date <= 18.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 18.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | |--- lead_time <= 137.50 | | | | | | | | | | |--- weights: [91.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 137.50 | | | | | | | | | | |--- lead_time <= 139.00 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- lead_time > 139.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | |--- avg_price_per_room > 180.43 | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | |--- market_segment_type_Online > 0.50 | | | | |--- lead_time <= 6.50 | | | | | |--- avg_price_per_room <= 157.64 | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | |--- lead_time <= 4.50 | | | | | | | | |--- room_type_reserved_Room_Type 2 <= 0.50 | | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | | |--- weights: [108.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | | |--- no_of_week_nights <= 4.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 4.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- room_type_reserved_Room_Type 2 > 0.50 | | | | | | | | | |--- no_of_children <= 1.00 | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_children > 1.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- lead_time > 4.50 | | | | | | | | |--- arrival_date <= 4.50 | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- arrival_date > 4.50 | | | | | | | | | |--- avg_price_per_room <= 134.92 | | | | | | | | | | |--- arrival_date <= 7.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- arrival_date > 7.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | |--- avg_price_per_room > 134.92 | | | | | | | | | | |--- avg_price_per_room <= 135.25 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 135.25 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | |--- avg_price_per_room <= 99.33 | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | |--- avg_price_per_room > 99.33 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | |--- avg_price_per_room > 157.64 | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | |--- arrival_date <= 30.50 | | | | | | | | |--- lead_time <= 4.50 | | | | | | | | | |--- avg_price_per_room <= 158.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 158.50 | | | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- lead_time > 4.50 | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | |--- arrival_date <= 14.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- arrival_date > 14.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- arrival_date > 30.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 10.50 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | |--- lead_time > 6.50 | | | | | |--- avg_price_per_room <= 118.62 | | | | | | |--- no_of_weekend_nights <= 2.50 | | | | | | | |--- lead_time <= 68.50 | | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | | |--- weights: [256.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_month > 1.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 22 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- truncated branch of depth 18 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- weights: [198.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 68.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | |--- arrival_date <= 26.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 26.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- arrival_month <= 3.50 | | | | | | | | | | |--- avg_price_per_room <= 71.19 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- avg_price_per_room > 71.19 | | | | | | | | | | | |--- truncated branch of depth 14 | | | | | | | | | |--- arrival_month > 3.50 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- truncated branch of depth 15 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | |--- no_of_weekend_nights > 2.50 | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | |--- arrival_date <= 10.50 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- arrival_date > 10.50 | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 1.50 | | | | | | | | |--- lead_time <= 108.50 | | | | | | | | | |--- arrival_date <= 5.50 | | | | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- arrival_date > 5.50 | | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | | |--- weights: [0.00, 19.00] class: 1.0 | | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- lead_time > 108.50 | | | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | |--- avg_price_per_room > 118.62 | | | | | | |--- required_car_parking_space <= 0.50 | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | |--- arrival_month <= 8.50 | | | | | | | | | |--- lead_time <= 142.50 | | | | | | | | | | |--- arrival_date <= 19.50 | | | | | | | | | | | |--- truncated branch of depth 18 | | | | | | | | | | |--- arrival_date > 19.50 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | |--- lead_time > 142.50 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | |--- arrival_month > 8.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | | | |--- truncated branch of depth 22 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- lead_time <= 102.00 | | | | | | | | | | | |--- weights: [77.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 102.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | |--- lead_time <= 150.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- avg_price_per_room <= 154.90 | | | | | | | | | | | |--- truncated branch of depth 23 | | | | | | | | | | |--- avg_price_per_room > 154.90 | | | | | | | | | | | |--- truncated branch of depth 22 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 124.70 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- avg_price_per_room > 124.70 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | |--- lead_time > 150.50 | | | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | | | |--- required_car_parking_space > 0.50 | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | |--- lead_time <= 150.00 | | | | | | | | | |--- weights: [126.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 150.00 | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | |--- no_of_special_requests > 1.50 | | | |--- lead_time <= 89.50 | | | | |--- no_of_week_nights <= 3.50 | | | | | |--- weights: [3272.00, 0.00] class: 0.0 | | | | |--- no_of_week_nights > 3.50 | | | | | |--- no_of_weekend_nights <= 4.50 | | | | | | |--- no_of_special_requests <= 2.50 | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | |--- room_type_reserved_Room_Type 5 <= 0.50 | | | | | | | | | |--- arrival_date <= 30.50 | | | | | | | | | | |--- avg_price_per_room <= 125.90 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | | |--- avg_price_per_room > 125.90 | | | | | | | | | | | |--- truncated branch of depth 11 | | | | | | | | | |--- arrival_date > 30.50 | | | | | | | | | | |--- lead_time <= 11.00 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 11.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- room_type_reserved_Room_Type 5 > 0.50 | | | | | | | | | |--- lead_time <= 37.50 | | | | | | | | | | |--- weights: [8.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 37.50 | | | | | | | | | | |--- arrival_date <= 22.00 | | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 22.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | |--- arrival_date <= 5.50 | | | | | | | | | |--- weights: [12.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 5.50 | | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | | |--- lead_time <= 37.00 | | | | | | | | | | | |--- weights: [12.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 37.00 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 100.84 | | | | | | | | | | | |--- truncated branch of depth 7 | | | | | | | | | | |--- avg_price_per_room > 100.84 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | |--- no_of_special_requests > 2.50 | | | | | | | |--- weights: [97.00, 0.00] class: 0.0 | | | | | |--- no_of_weekend_nights > 4.50 | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | |--- lead_time > 89.50 | | | | |--- no_of_special_requests <= 2.50 | | | | | |--- avg_price_per_room <= 192.29 | | | | | | |--- arrival_month <= 4.50 | | | | | | | |--- avg_price_per_room <= 71.13 | | | | | | | | |--- weights: [13.00, 0.00] class: 0.0 | | | | | | | |--- avg_price_per_room > 71.13 | | | | | | | | |--- avg_price_per_room <= 73.04 | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- avg_price_per_room > 73.04 | | | | | | | | | |--- lead_time <= 123.50 | | | | | | | | | | |--- avg_price_per_room <= 98.95 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- avg_price_per_room > 98.95 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- lead_time > 123.50 | | | | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | |--- arrival_month > 4.50 | | | | | | | |--- arrival_month <= 8.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | |--- lead_time <= 98.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- lead_time > 98.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- lead_time <= 150.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | |--- lead_time > 150.50 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- arrival_month > 8.50 | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- arrival_month <= 10.50 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 10.50 | | | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- lead_time <= 142.00 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | | |--- lead_time > 142.00 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | | | |--- avg_price_per_room <= 79.95 | | | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 79.95 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- arrival_month > 11.50 | | | | | | | | | | |--- lead_time <= 124.50 | | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 124.50 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | |--- avg_price_per_room > 192.29 | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | |--- lead_time <= 127.50 | | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | | |--- avg_price_per_room <= 195.88 | | | | | | | | | | |--- arrival_date <= 24.50 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 24.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 195.88 | | | | | | | | | | |--- arrival_date <= 8.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 8.50 | | | | | | | | | | | |--- weights: [0.00, 11.00] class: 1.0 | | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 127.50 | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | |--- weights: [0.00, 13.00] class: 1.0 | | | | |--- no_of_special_requests > 2.50 | | | | | |--- weights: [198.00, 0.00] class: 0.0 |--- lead_time > 151.50 | |--- avg_price_per_room <= 100.04 | | |--- no_of_special_requests <= 0.50 | | | |--- market_segment_type_Online <= 0.50 | | | | |--- no_of_adults <= 1.50 | | | | | |--- lead_time <= 163.50 | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 6.50 | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | |--- no_of_week_nights <= 4.00 | | | | | | | | |--- weights: [0.00, 20.00] class: 1.0 | | | | | | | |--- no_of_week_nights > 4.00 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | |--- lead_time > 163.50 | | | | | | |--- lead_time <= 323.25 | | | | | | | |--- lead_time <= 175.50 | | | | | | | | |--- arrival_date <= 23.00 | | | | | | | | | |--- avg_price_per_room <= 79.10 | | | | | | | | | | |--- arrival_month <= 7.50 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 7.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- avg_price_per_room > 79.10 | | | | | | | | | | |--- arrival_month <= 9.50 | | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_month > 9.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- arrival_date > 23.00 | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | |--- lead_time > 175.50 | | | | | | | | |--- avg_price_per_room <= 98.00 | | | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | | | |--- arrival_date <= 9.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_date > 9.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- arrival_month > 5.50 | | | | | | | | | | |--- avg_price_per_room <= 57.29 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- avg_price_per_room > 57.29 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | |--- avg_price_per_room > 98.00 | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | |--- lead_time > 323.25 | | | | | | | |--- arrival_date <= 14.50 | | | | | | | | |--- no_of_week_nights <= 4.50 | | | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | |--- arrival_month > 6.50 | | | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | | | |--- weights: [20.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_week_nights > 4.50 | | | | | | | | | |--- avg_price_per_room <= 88.33 | | | | | | | | | | |--- weights: [0.00, 7.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 88.33 | | | | | | | | | | |--- weights: [2.00, 1.00] class: 0.0 | | | | | | | |--- arrival_date > 14.50 | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | |--- weights: [0.00, 9.00] class: 1.0 | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 88.00 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 88.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | |--- no_of_adults > 1.50 | | | | | |--- avg_price_per_room <= 84.42 | | | | | | |--- lead_time <= 273.00 | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | |--- lead_time <= 172.50 | | | | | | | | | |--- arrival_date <= 6.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 6.00 | | | | | | | | | | |--- lead_time <= 161.00 | | | | | | | | | | | |--- weights: [29.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 161.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | |--- lead_time > 172.50 | | | | | | | | | |--- avg_price_per_room <= 77.50 | | | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 77.50 | | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | |--- no_of_previous_cancellations <= 6.50 | | | | | | | | | |--- lead_time <= 174.50 | | | | | | | | | | |--- lead_time <= 173.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | | | |--- lead_time > 173.50 | | | | | | | | | | | |--- weights: [0.00, 11.00] class: 1.0 | | | | | | | | | |--- lead_time > 174.50 | | | | | | | | | | |--- avg_price_per_room <= 29.07 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 29.07 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | |--- no_of_previous_cancellations > 6.50 | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | |--- lead_time > 273.00 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- arrival_year <= 2017.50 | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_year > 2017.50 | | | | | | | | | |--- avg_price_per_room <= 80.42 | | | | | | | | | | |--- no_of_week_nights <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 6 | | | | | | | | | | |--- no_of_week_nights > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- avg_price_per_room > 80.42 | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [29.00, 0.00] class: 0.0 | | | | | |--- avg_price_per_room > 84.42 | | | | | | |--- lead_time <= 196.00 | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | | |--- lead_time <= 183.50 | | | | | | | | | | |--- weights: [0.00, 33.00] class: 1.0 | | | | | | | | | |--- lead_time > 183.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | | |--- avg_price_per_room <= 94.53 | | | | | | | | | | |--- no_of_week_nights <= 5.00 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- no_of_week_nights > 5.00 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 94.53 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- arrival_month > 6.50 | | | | | | | | |--- lead_time <= 155.50 | | | | | | | | | |--- avg_price_per_room <= 97.60 | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 97.60 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- lead_time > 155.50 | | | | | | | | | |--- weights: [21.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 196.00 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- no_of_adults <= 2.50 | | | | | | | | | |--- room_type_reserved_Room_Type 4 <= 0.50 | | | | | | | | | | |--- arrival_date <= 2.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 2.50 | | | | | | | | | | | |--- truncated branch of depth 12 | | | | | | | | | |--- room_type_reserved_Room_Type 4 > 0.50 | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- no_of_adults > 2.50 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | |--- market_segment_type_Online > 0.50 | | | | |--- avg_price_per_room <= 17.98 | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | |--- arrival_date <= 11.00 | | | | | | | |--- lead_time <= 249.75 | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 249.75 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | |--- arrival_date > 11.00 | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | |--- arrival_date <= 8.50 | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | | |--- arrival_date > 8.50 | | | | | | | |--- weights: [8.00, 0.00] class: 0.0 | | | | |--- avg_price_per_room > 17.98 | | | | | |--- no_of_adults <= 2.50 | | | | | | |--- arrival_month <= 11.50 | | | | | | | |--- weights: [0.00, 865.00] class: 1.0 | | | | | | |--- arrival_month > 11.50 | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | |--- avg_price_per_room <= 73.77 | | | | | | | | | |--- no_of_week_nights <= 0.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 0.50 | | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- avg_price_per_room > 73.77 | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | |--- no_of_weekend_nights <= 0.50 | | | | | | | | | |--- avg_price_per_room <= 76.87 | | | | | | | | | | |--- weights: [0.00, 10.00] class: 1.0 | | | | | | | | | |--- avg_price_per_room > 76.87 | | | | | | | | | | |--- lead_time <= 270.00 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 270.00 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | |--- no_of_weekend_nights > 0.50 | | | | | | | | | |--- weights: [0.00, 56.00] class: 1.0 | | | | | |--- no_of_adults > 2.50 | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | |--- no_of_special_requests > 0.50 | | | |--- no_of_weekend_nights <= 0.50 | | | | |--- lead_time <= 180.50 | | | | | |--- arrival_date <= 30.50 | | | | | | |--- arrival_date <= 22.00 | | | | | | | |--- arrival_year <= 2018.50 | | | | | | | | |--- lead_time <= 156.50 | | | | | | | | | |--- arrival_month <= 6.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_month > 6.50 | | | | | | | | | | |--- arrival_date <= 12.50 | | | | | | | | | | | |--- weights: [3.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 12.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | |--- lead_time > 156.50 | | | | | | | | | |--- weights: [47.00, 0.00] class: 0.0 | | | | | | | |--- arrival_year > 2018.50 | | | | | | | | |--- arrival_date <= 6.00 | | | | | | | | | |--- avg_price_per_room <= 80.55 | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 80.55 | | | | | | | | | | |--- avg_price_per_room <= 89.70 | | | | | | | | | | | |--- weights: [0.00, 3.00] class: 1.0 | | | | | | | | | | |--- avg_price_per_room > 89.70 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 6.00 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- weights: [16.00, 0.00] class: 0.0 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | |--- arrival_date > 22.00 | | | | | | | |--- arrival_month <= 2.00 | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | |--- arrival_month > 2.00 | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | |--- type_of_meal_plan_Not Selected <= 0.50 | | | | | | | | | | |--- lead_time <= 161.00 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 161.00 | | | | | | | | | | | |--- weights: [15.00, 0.00] class: 0.0 | | | | | | | | | |--- type_of_meal_plan_Not Selected > 0.50 | | | | | | | | | | |--- avg_price_per_room <= 98.01 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- avg_price_per_room > 98.01 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | |--- arrival_date > 30.50 | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | |--- lead_time > 180.50 | | | | | |--- no_of_special_requests <= 2.50 | | | | | | |--- market_segment_type_Online <= 0.50 | | | | | | | |--- avg_price_per_room <= 93.22 | | | | | | | | |--- arrival_date <= 7.50 | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- arrival_date > 7.50 | | | | | | | | | |--- lead_time <= 190.00 | | | | | | | | | | |--- arrival_date <= 25.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | | | |--- arrival_date > 25.50 | | | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 190.00 | | | | | | | | | | |--- lead_time <= 317.25 | | | | | | | | | | | |--- weights: [23.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 317.25 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- avg_price_per_room > 93.22 | | | | | | | | |--- arrival_date <= 16.00 | | | | | | | | | |--- weights: [2.00, 0.00] class: 0.0 | | | | | | | | |--- arrival_date > 16.00 | | | | | | | | | |--- arrival_date <= 22.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 22.50 | | | | | | | | | | |--- weights: [1.00, 6.00] class: 1.0 | | | | | | |--- market_segment_type_Online > 0.50 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- avg_price_per_room <= 36.16 | | | | | | | | | |--- weights: [6.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 36.16 | | | | | | | | | |--- arrival_month <= 1.50 | | | | | | | | | | |--- arrival_date <= 11.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 11.50 | | | | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | | | | |--- arrival_month > 1.50 | | | | | | | | | | |--- weights: [0.00, 249.00] class: 1.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- lead_time <= 300.50 | | | | | | | | | |--- no_of_children <= 0.50 | | | | | | | | | | |--- lead_time <= 221.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- lead_time > 221.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | |--- no_of_children > 0.50 | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- lead_time > 300.50 | | | | | | | | | |--- weights: [0.00, 6.00] class: 1.0 | | | | | |--- no_of_special_requests > 2.50 | | | | | | |--- weights: [27.00, 0.00] class: 0.0 | | | |--- no_of_weekend_nights > 0.50 | | | | |--- market_segment_type_Online <= 0.50 | | | | | |--- lead_time <= 315.00 | | | | | | |--- no_of_special_requests <= 1.50 | | | | | | | |--- lead_time <= 157.50 | | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | | |--- avg_price_per_room <= 76.17 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | |--- avg_price_per_room > 76.17 | | | | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | |--- lead_time > 157.50 | | | | | | | | |--- weights: [160.00, 0.00] class: 0.0 | | | | | | |--- no_of_special_requests > 1.50 | | | | | | | |--- no_of_week_nights <= 2.50 | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | |--- no_of_week_nights > 2.50 | | | | | | | | |--- arrival_date <= 22.00 | | | | | | | | | |--- lead_time <= 215.50 | | | | | | | | | | |--- weights: [9.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 215.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | |--- arrival_date > 22.00 | | | | | | | | | |--- arrival_date <= 27.00 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- arrival_date > 27.00 | | | | | | | | | | |--- weights: [1.00, 1.00] class: 0.0 | | | | | |--- lead_time > 315.00 | | | | | | |--- arrival_date <= 5.50 | | | | | | | |--- no_of_adults <= 1.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | |--- no_of_adults > 1.50 | | | | | | | | |--- weights: [0.00, 4.00] class: 1.0 | | | | | | |--- arrival_date > 5.50 | | | | | | | |--- arrival_month <= 5.50 | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | |--- arrival_month > 5.50 | | | | | | | | |--- avg_price_per_room <= 90.33 | | | | | | | | | |--- arrival_date <= 13.50 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 13.50 | | | | | | | | | | |--- no_of_special_requests <= 2.00 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | | | | |--- no_of_special_requests > 2.00 | | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 90.33 | | | | | | | | | |--- weights: [17.00, 0.00] class: 0.0 | | | | |--- market_segment_type_Online > 0.50 | | | | | |--- no_of_special_requests <= 2.50 | | | | | | |--- arrival_year <= 2018.50 | | | | | | | |--- arrival_month <= 11.50 | | | | | | | | |--- no_of_weekend_nights <= 3.50 | | | | | | | | | |--- avg_price_per_room <= 75.87 | | | | | | | | | | |--- lead_time <= 245.50 | | | | | | | | | | | |--- weights: [50.00, 0.00] class: 0.0 | | | | | | | | | | |--- lead_time > 245.50 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | |--- avg_price_per_room > 75.87 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 <= 0.50 | | | | | | | | | | | |--- truncated branch of depth 16 | | | | | | | | | | |--- type_of_meal_plan_Meal Plan 2 > 0.50 | | | | | | | | | | | |--- weights: [0.00, 2.00] class: 1.0 | | | | | | | | |--- no_of_weekend_nights > 3.50 | | | | | | | | | |--- no_of_week_nights <= 5.50 | | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | | |--- no_of_week_nights > 5.50 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | | |--- arrival_month > 11.50 | | | | | | | | |--- avg_price_per_room <= 55.92 | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 55.92 | | | | | | | | | |--- lead_time <= 302.00 | | | | | | | | | | |--- arrival_date <= 29.50 | | | | | | | | | | | |--- truncated branch of depth 9 | | | | | | | | | | |--- arrival_date > 29.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | |--- lead_time > 302.00 | | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | | | | | |--- arrival_year > 2018.50 | | | | | | | |--- avg_price_per_room <= 74.71 | | | | | | | | |--- avg_price_per_room <= 66.30 | | | | | | | | | |--- weights: [10.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 66.30 | | | | | | | | | |--- lead_time <= 161.00 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | | |--- lead_time > 161.00 | | | | | | | | | | |--- arrival_month <= 3.50 | | | | | | | | | | | |--- truncated branch of depth 2 | | | | | | | | | | |--- arrival_month > 3.50 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | | | |--- avg_price_per_room > 74.71 | | | | | | | | |--- arrival_month <= 4.50 | | | | | | | | | |--- arrival_date <= 25.50 | | | | | | | | | | |--- avg_price_per_room <= 99.10 | | | | | | | | | | | |--- truncated branch of depth 13 | | | | | | | | | | |--- avg_price_per_room > 99.10 | | | | | | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | | | | | |--- arrival_date > 25.50 | | | | | | | | | | |--- arrival_date <= 27.50 | | | | | | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | | | | | | |--- arrival_date > 27.50 | | | | | | | | | | | |--- truncated branch of depth 5 | | | | | | | | |--- arrival_month > 4.50 | | | | | | | | | |--- lead_time <= 301.50 | | | | | | | | | | |--- no_of_weekend_nights <= 1.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | | |--- no_of_weekend_nights > 1.50 | | | | | | | | | | | |--- truncated branch of depth 8 | | | | | | | | | |--- lead_time > 301.50 | | | | | | | | | | |--- avg_price_per_room <= 95.72 | | | | | | | | | | | |--- truncated branch of depth 4 | | | | | | | | | | |--- avg_price_per_room > 95.72 | | | | | | | | | | | |--- truncated branch of depth 3 | | | | | |--- no_of_special_requests > 2.50 | | | | | | |--- weights: [51.00, 0.00] class: 0.0 | |--- avg_price_per_room > 100.04 | | |--- no_of_special_requests <= 2.50 | | | |--- arrival_month <= 11.50 | | | | |--- arrival_month <= 1.50 | | | | | |--- no_of_special_requests <= 0.50 | | | | | | |--- weights: [7.00, 0.00] class: 0.0 | | | | | |--- no_of_special_requests > 0.50 | | | | | | |--- arrival_date <= 17.00 | | | | | | | |--- required_car_parking_space <= 0.50 | | | | | | | | |--- avg_price_per_room <= 105.72 | | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | | | |--- avg_price_per_room > 105.72 | | | | | | | | | |--- weights: [0.00, 12.00] class: 1.0 | | | | | | | |--- required_car_parking_space > 0.50 | | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- arrival_date > 17.00 | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | |--- arrival_month > 1.50 | | | | | |--- weights: [0.00, 4532.00] class: 1.0 | | | |--- arrival_month > 11.50 | | | | |--- no_of_special_requests <= 0.50 | | | | | |--- weights: [55.00, 0.00] class: 0.0 | | | | |--- no_of_special_requests > 0.50 | | | | | |--- arrival_date <= 24.00 | | | | | | |--- weights: [5.00, 0.00] class: 0.0 | | | | | |--- arrival_date > 24.00 | | | | | | |--- lead_time <= 153.50 | | | | | | | |--- weights: [1.00, 0.00] class: 0.0 | | | | | | |--- lead_time > 153.50 | | | | | | | |--- avg_price_per_room <= 121.55 | | | | | | | | |--- weights: [0.00, 8.00] class: 1.0 | | | | | | | |--- avg_price_per_room > 121.55 | | | | | | | | |--- room_type_reserved_Room_Type 6 <= 0.50 | | | | | | | | | |--- no_of_week_nights <= 1.50 | | | | | | | | | | |--- weights: [0.00, 1.00] class: 1.0 | | | | | | | | | |--- no_of_week_nights > 1.50 | | | | | | | | | | |--- weights: [4.00, 0.00] class: 0.0 | | | | | | | | |--- room_type_reserved_Room_Type 6 > 0.50 | | | | | | | | | |--- weights: [0.00, 5.00] class: 1.0 | | |--- no_of_special_requests > 2.50 | | | |--- weights: [154.00, 0.00] class: 0.0
# importance of features in the tree building ( The importance of a feature is computed as the
# (normalized) total reduction of the 'criterion' brought by that feature. It is also known as the Gini importance )
print(
pd.DataFrame(
estimator.feature_importances_, columns=["Imp"], index=X_train.columns
).sort_values(by="Imp", ascending=False)
)
# Here we will see that importance of features has increased
Imp lead_time 0.557049 market_segment_type_Online 0.233385 no_of_special_requests 0.209566 no_of_weekend_nights 0.000000 type_of_meal_plan_Meal Plan 3 0.000000 market_segment_type_Offline 0.000000 market_segment_type_Corporate 0.000000 market_segment_type_Complementary 0.000000 room_type_reserved_Room_Type 7 0.000000 room_type_reserved_Room_Type 6 0.000000 room_type_reserved_Room_Type 5 0.000000 room_type_reserved_Room_Type 4 0.000000 room_type_reserved_Room_Type 3 0.000000 room_type_reserved_Room_Type 2 0.000000 type_of_meal_plan_Not Selected 0.000000 type_of_meal_plan_Meal Plan 2 0.000000 no_of_week_nights 0.000000 no_of_adults 0.000000 avg_price_per_room 0.000000 no_of_previous_bookings_not_canceled 0.000000 no_of_previous_cancellations 0.000000 repeated_guest 0.000000 arrival_date 0.000000 arrival_month 0.000000 arrival_year 0.000000 no_of_children 0.000000 required_car_parking_space 0.000000 const 0.000000
importances = estimator.feature_importances_
indices = np.argsort(importances)
plt.figure(figsize=(12, 12))
plt.title("Feature Importances")
plt.barh(range(len(indices)), importances[indices], color="violet", align="center")
plt.yticks(range(len(indices)), [feature_names[i] for i in indices])
plt.xlabel("Relative Importance")
plt.show()
lead time is the first parameter that influence cancellation and average price per room comes in second according to the Decision Tree model
The DecisionTreeClassifier provides parameters such as
min_samples_leaf and max_depth to prevent a tree from overfiting. Cost
complexity pruning provides another option to control the size of a tree. In
DecisionTreeClassifier, this pruning technique is parameterized by the
cost complexity parameter, ccp_alpha. Greater values of ccp_alpha
increase the number of nodes pruned. Here we only show the effect of
ccp_alpha on regularizing the trees and how to choose a ccp_alpha
based on validation scores.
Minimal cost complexity pruning recursively finds the node with the "weakest
link". The weakest link is characterized by an effective alpha, where the
nodes with the smallest effective alpha are pruned first. To get an idea of
what values of ccp_alpha could be appropriate, scikit-learn provides
DecisionTreeClassifier.cost_complexity_pruning_path that returns the
effective alphas and the corresponding total leaf impurities at each step of
the pruning process. As alpha increases, more of the tree is pruned, which
increases the total impurity of its leaves.
clf = DecisionTreeClassifier(random_state=1, class_weight={0:0.4, 1:0.6})
path = clf.cost_complexity_pruning_path(X_train, y_train.astype('float'))
ccp_alphas, impurities = path.ccp_alphas, path.impurities
pd.DataFrame(path)
| ccp_alphas | impurities | |
|---|---|---|
| 0 | 0.000000e+00 | 0.007408 |
| 1 | 2.107774e-20 | 0.007408 |
| 2 | 2.107774e-20 | 0.007408 |
| 3 | 2.107774e-20 | 0.007408 |
| 4 | 2.107774e-20 | 0.007408 |
| ... | ... | ... |
| 3199 | 7.462637e-03 | 0.331831 |
| 3200 | 1.191042e-02 | 0.343742 |
| 3201 | 1.224173e-02 | 0.355983 |
| 3202 | 2.569581e-02 | 0.407375 |
| 3203 | 9.168050e-02 | 0.499055 |
3204 rows × 2 columns
fig, ax = plt.subplots(figsize=(10, 5))
ax.plot(ccp_alphas[:-1], impurities[:-1], marker="o", drawstyle="steps-post")
ax.set_xlabel("effective alpha")
ax.set_ylabel("total impurity of leaves")
ax.set_title("Total Impurity vs effective alpha for training set")
plt.show()
Next, we train a decision tree using the effective alphas. The last value
in ccp_alphas is the alpha value that prunes the whole tree,
leaving the tree, clfs[-1], with one node.
clfs = []
for ccp_alpha in ccp_alphas:
clf = DecisionTreeClassifier(
random_state=1, ccp_alpha=ccp_alpha)
clf.fit(X_train, y_train.astype('float'))
clfs.append(clf)
print(
"Number of nodes in the last tree is: {} with ccp_alpha: {}".format(
clfs[-1].tree_.node_count, ccp_alphas[-1]
)
)
Number of nodes in the last tree is: 1 with ccp_alpha: 0.09168050054670124
clfs = clfs[:-1]
ccp_alphas = ccp_alphas[:-1]
node_counts = [clf.tree_.node_count for clf in clfs]
depth = [clf.tree_.max_depth for clf in clfs]
fig, ax = plt.subplots(2, 1, figsize=(10, 7))
ax[0].plot(ccp_alphas, node_counts, marker="o", drawstyle="steps-post")
ax[0].set_xlabel("alpha")
ax[0].set_ylabel("number of nodes")
ax[0].set_title("Number of nodes vs alpha")
ax[1].plot(ccp_alphas, depth, marker="o", drawstyle="steps-post")
ax[1].set_xlabel("alpha")
ax[1].set_ylabel("depth of tree")
ax[1].set_title("Depth vs alpha")
fig.tight_layout()
recall_train = []
for clf in clfs:
pred_train = clf.predict(X_train)
values_train = recall_score(y_train.astype('float'), pred_train.astype('float'))
recall_train.append(values_train)
recall_test = []
for clf in clfs:
pred_test = clf.predict(X_test)
values_test = recall_score(y_test.astype('float'), pred_test.astype('float'))
recall_test.append(values_test)
train_scores = [clf.score(X_train, y_train.astype('float')) for clf in clfs]
test_scores = [clf.score(X_test, y_test.astype('float')) for clf in clfs]
fig, ax = plt.subplots(figsize=(15, 5))
ax.set_xlabel("alpha")
ax.set_ylabel("Recall")
ax.set_title("Recall vs alpha for training and testing sets")
ax.plot(
ccp_alphas, recall_train, marker="o", label="train", drawstyle="steps-post",
)
ax.plot(ccp_alphas, recall_test, marker="o", label="test", drawstyle="steps-post")
ax.legend()
plt.show()
Maximum value of record correspond to a ccp alpha value of 0.0125 However a closer to 0 ccp_alpha may have sense as recall is higher
# creating the model where we get highest train and test recall
index_best_model = np.argmax(recall_test)
best_model = clfs[index_best_model]
print(best_model)
DecisionTreeClassifier(ccp_alpha=1.2517673970459054e-05, random_state=1)
best_model.fit(X_train, y_train)
DecisionTreeClassifier(ccp_alpha=1.2517673970459054e-05, random_state=1)
Checking performance on training set
confusion_matrix_sklearn(best_model, X_train, y_train)
y_pred_test4 = model.predict(X_test)
decision_tree_post_prune_train = recall_score(y_test.astype('float'), y_pred_test4.astype('float'))
print(f'the recall score is :', decision_tree_post_prune_train)
the recall score is : 0.8028913415202861
Checking performance on test set
confusion_matrix_sklearn(best_model, X_test, y_test)
y_pred_test4 = model.predict(X_test)
decision_tree_post_prune_test = recall_score(y_test.astype('float'), y_pred_test4.astype('float'))
print(f'the recall score is :', decision_tree_post_prune_test)
the recall score is : 0.8028913415202861
Recall is the same in train and test set, which is a good point
plt.figure(figsize=(5, 5))
out = tree.plot_tree(
best_model,
feature_names=feature_names,
filled=True,
fontsize=9,
node_ids=False,
class_names=None,
)
for o in out:
arrow = o.arrow_patch
if arrow is not None:
arrow.set_edgecolor("black")
arrow.set_linewidth(1)
plt.show()
However the model overfit with a 0.00125 ccp_alpha. This makes us conclude that we should use a close to 0 ccp_alpha
Checking with ccp_alpha = 0.002
best_model2 = DecisionTreeClassifier(
ccp_alpha=0.002, class_weight={0: 0.4, 1: 0.6}, random_state=1
)
best_model2.fit(X_train, y_train.astype('float'))
DecisionTreeClassifier(ccp_alpha=0.002, class_weight={0: 0.4, 1: 0.6},
random_state=1)
Checking performance on training set
confusion_matrix_sklearn(best_model2, X_train, y_train.astype('float'))
y_pred_test5 = model.predict(X_test)
decision_tree_post_prune_perf_train = recall_score(y_test.astype('float'), y_pred_test5.astype('float'))
print(f'the recall score is :', decision_tree_post_prune_perf_train)
the recall score is : 0.8028913415202861
Checking performance on test set
confusion_matrix_sklearn(best_model2, X_test, y_test.astype('float'))
y_pred_test5 = model.predict(X_test)
decision_tree_post_prune_perf_test = recall_score(y_test.astype('float'), y_pred_test5.astype('float'))
print(f'the recall score is :', decision_tree_post_prune_perf_test)
the recall score is : 0.8028913415202861
plt.figure(figsize=(15, 10))
out = tree.plot_tree(
best_model2,
feature_names=feature_names,
filled=True,
fontsize=9,
node_ids=False,
class_names=None,
)
for o in out:
arrow = o.arrow_patch
if arrow is not None:
arrow.set_edgecolor("black")
arrow.set_linewidth(1)
plt.show()
Model looks clean, non overfit
# Text report showing the rules of a decision tree -
print(tree.export_text(best_model2, feature_names=feature_names, show_weights=True))
|--- lead_time <= 150.50 | |--- no_of_special_requests <= 0.50 | | |--- market_segment_type_Online <= 0.50 | | | |--- lead_time <= 88.50 | | | | |--- weights: [1901.60, 345.00] class: 0.0 | | | |--- lead_time > 88.50 | | | | |--- avg_price_per_room <= 93.33 | | | | | |--- weights: [254.00, 128.40] class: 0.0 | | | | |--- avg_price_per_room > 93.33 | | | | | |--- weights: [147.60, 272.40] class: 1.0 | | |--- market_segment_type_Online > 0.50 | | | |--- lead_time <= 9.50 | | | | |--- weights: [535.60, 193.80] class: 0.0 | | | |--- lead_time > 9.50 | | | | |--- avg_price_per_room <= 99.88 | | | | | |--- weights: [499.20, 712.20] class: 1.0 | | | | |--- avg_price_per_room > 99.88 | | | | | |--- weights: [611.20, 1837.20] class: 1.0 | |--- no_of_special_requests > 0.50 | | |--- no_of_special_requests <= 1.50 | | | |--- market_segment_type_Online <= 0.50 | | | | |--- weights: [576.80, 22.80] class: 0.0 | | | |--- market_segment_type_Online > 0.50 | | | | |--- lead_time <= 6.50 | | | | | |--- weights: [460.40, 36.00] class: 0.0 | | | | |--- lead_time > 6.50 | | | | | |--- weights: [2259.60, 1144.80] class: 0.0 | | |--- no_of_special_requests > 1.50 | | | |--- lead_time <= 89.50 | | | | |--- weights: [1484.80, 34.80] class: 0.0 | | | |--- lead_time > 89.50 | | | | |--- weights: [334.00, 148.80] class: 0.0 |--- lead_time > 150.50 | |--- avg_price_per_room <= 100.04 | | |--- no_of_special_requests <= 0.50 | | | |--- market_segment_type_Online <= 0.50 | | | | |--- no_of_adults <= 1.50 | | | | | |--- weights: [168.00, 57.00] class: 0.0 | | | | |--- no_of_adults > 1.50 | | | | | |--- avg_price_per_room <= 84.42 | | | | | | |--- weights: [139.20, 168.60] class: 1.0 | | | | | |--- avg_price_per_room > 84.42 | | | | | | |--- weights: [30.00, 297.60] class: 1.0 | | | |--- market_segment_type_Online > 0.50 | | | | |--- weights: [8.80, 573.60] class: 1.0 | | |--- no_of_special_requests > 0.50 | | | |--- no_of_weekend_nights <= 0.50 | | | | |--- weights: [76.00, 176.40] class: 1.0 | | | |--- no_of_weekend_nights > 0.50 | | | | |--- weights: [311.20, 147.60] class: 0.0 | |--- avg_price_per_room > 100.04 | | |--- no_of_special_requests <= 2.50 | | | |--- weights: [31.60, 2772.00] class: 1.0 | | |--- no_of_special_requests > 2.50 | | | |--- weights: [63.60, 0.00] class: 0.0
# importance of features in the tree building ( The importance of a feature is computed as the
# (normalized) total reduction of the 'criterion' brought by that feature. It is also known as the Gini importance )
print(
pd.DataFrame(
best_model2.feature_importances_, columns=["Imp"], index=X_train.columns
).sort_values(by="Imp", ascending=False)
)
Imp lead_time 0.536883 no_of_special_requests 0.180781 market_segment_type_Online 0.166944 avg_price_per_room 0.085718 no_of_adults 0.018498 no_of_weekend_nights 0.011175 type_of_meal_plan_Not Selected 0.000000 market_segment_type_Offline 0.000000 market_segment_type_Corporate 0.000000 market_segment_type_Complementary 0.000000 room_type_reserved_Room_Type 7 0.000000 room_type_reserved_Room_Type 6 0.000000 room_type_reserved_Room_Type 5 0.000000 room_type_reserved_Room_Type 4 0.000000 room_type_reserved_Room_Type 3 0.000000 room_type_reserved_Room_Type 2 0.000000 type_of_meal_plan_Meal Plan 2 0.000000 type_of_meal_plan_Meal Plan 3 0.000000 no_of_week_nights 0.000000 no_of_previous_bookings_not_canceled 0.000000 no_of_previous_cancellations 0.000000 repeated_guest 0.000000 arrival_date 0.000000 arrival_month 0.000000 arrival_year 0.000000 no_of_children 0.000000 required_car_parking_space 0.000000 const 0.000000
importances = best_model2.feature_importances_
indices = np.argsort(importances)
plt.figure(figsize=(12, 12))
plt.title("Feature Importances")
plt.barh(range(len(indices)), importances[indices], color="violet", align="center")
plt.yticks(range(len(indices)), [feature_names[i] for i in indices])
plt.xlabel("Relative Importance")
plt.show()
Observations
# training performance comparison
models_train_comp_df = pd.DataFrame(
[
decision_tree_perf_train,
decision_tree_tune_perf_train,
decision_tree_post_prune_perf_train,
],
columns=["Recall on training set"],
)
print("Training performance comparison:")
models_train_comp_df
Training performance comparison:
| Recall on training set | |
|---|---|
| 0 | 0.988356 |
| 1 | 0.802891 |
| 2 | 0.802891 |
# testing performance comparison
models_test_comp_df = pd.DataFrame(
[
decision_tree_perf_test,
decision_tree_tune_perf_test,
decision_tree_post_prune_perf_test,
],
columns=["Recall on testing set"],
)
print("Test performance comparison:")
models_test_comp_df
Test performance comparison:
| Recall on testing set | |
|---|---|
| 0 | 0.802891 |
| 1 | 0.802891 |
| 2 | 0.802891 |
Model comparison show an improvement from the first decision tree model and the final one. This make us confortable with the results obtained. Besides, these results confirmed all previous works. The redondance of these results strengthened the conclusions.
As seen trhough EDA, Logistic Regression and Decision Tree approach, the canceled profile can be define by these key elements :
Some elements are underlined in some approach and not in others :
All in all some elements suggest that the cancelers (canceled) have more a "family" profile than non cancelers (or not canceled). Non cancelers, at the opposite, looks more corporate customers.
Canceler detection : it appears that if the leadtime is close to 143 days and if the market segment is online we may have a canceler. This could be strengthened by the lack of special request and week-end nights reservations.
We suggest to reduce price per room for newcomers (people with no cancellation or not_cancellation history) it looks that this parameter is weighing on the cancellation decision. Newcomers are found to be more keen on cancellation in some approach.
We recommand to strengthened marketing on corporate in order to reduce cancelers (canceled) as it appears that not_canceled have a "corporate profile".
These measures may help to avoid cancellation, facilitate room repositionning when a cancellation appear and reduce cancellation probability